Skip to content

Commit

Permalink
Merge branch 'master' into snyk-fix-644b54306cf80f7325bf13870f812551
Browse files Browse the repository at this point in the history
  • Loading branch information
StarNumber12046 authored Nov 18, 2023
2 parents 9347956 + b72d45f commit b5dd973
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 33 deletions.
1 change: 0 additions & 1 deletion cogs/carbon.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def __init__(self, bot):

@commands.command()
async def carbonate(self, ctx, *, code):

carbon_url = code_to_url(code)
r = requests.get(carbon_url)

Expand Down
2 changes: 0 additions & 2 deletions cogs/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ async def on_command_error(self, ctx, error):
pass
elif isinstance(error, commands.ArgumentParsingError):
if isinstance(error, commands.UnexpectedQuoteError):

await ctx.send("Invalid quotes!")
elif isinstance(error, commands.InvalidEndOfQuotedStringError):
await ctx.send("I don't understand this syntax")
Expand All @@ -69,7 +68,6 @@ async def on_command_error(self, ctx, error):
elif isinstance(error, commands.BadInviteArgument):
await ctx.send("I am not invited to that party!")
elif isinstance(error, commands.EmojiNotFound):

await ctx.send("What emoji?")
elif isinstance(error, commands.PartialEmojiConversionFailure):
await ctx.send("This emoji has too low data")
Expand Down
1 change: 0 additions & 1 deletion cogs/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ async def on_message(self, message):
settings = json.load(f)
f.close()
if settings["autopublishing"] == "True":

await message.publish()

@commands.Cog.listener()
Expand Down
9 changes: 0 additions & 9 deletions cogs/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ async def cat(self, ctx):
@commands.command(name="pat", aliases=["pet"])
@commands.cooldown(rate=2, per=5, type=commands.BucketType.member)
async def pet(self, ctx, image: discord.Member = None):

if type(image) == discord.member.Member:
image = await image.avatar.read() # retrieve the image bytes
else:
Expand All @@ -41,7 +40,6 @@ async def pet(self, ctx, image: discord.Member = None):
@commands.cooldown(rate=1, per=5, type=commands.BucketType.member)
async def passed(self, ctx, user: discord.User = None):
if user:

r = requests.get(
"https://some-random-api.ml/canvas/passed?avatar=" + user.avatar.url
)
Expand All @@ -58,7 +56,6 @@ async def passed(self, ctx, user: discord.User = None):
@commands.cooldown(rate=1, per=5, type=commands.BucketType.member)
async def comunism(self, ctx, user: discord.User = None):
if user:

r = requests.get(
"https://some-random-api.ml/canvas/comrade?avatar=" + user.avatar.url
)
Expand All @@ -75,7 +72,6 @@ async def comunism(self, ctx, user: discord.User = None):
@commands.cooldown(rate=1, per=5, type=commands.BucketType.member)
async def jail(self, ctx, user: discord.User = None):
if user:

r = requests.get(
"https://some-random-api.ml/canvas/jail?avatar=" + user.avatar.url
)
Expand All @@ -91,7 +87,6 @@ async def jail(self, ctx, user: discord.User = None):
@commands.cooldown(rate=1, per=5, type=commands.BucketType.member)
async def rip(self, ctx, user: discord.User = None):
if user:

r = requests.get("https://vacefron.nl/api/grave?user=" + user.avatar.url)
else:
r = requests.get(
Expand All @@ -104,7 +99,6 @@ async def rip(self, ctx, user: discord.User = None):
@commands.command()
@commands.cooldown(rate=1, per=5, type=commands.BucketType.member)
async def emergency(self, ctx, text):

r = requests.get(
"https://vacefron.nl/api/emergencymeeting?text=" + text.replace(" ", "%20")
)
Expand Down Expand Up @@ -167,7 +161,6 @@ async def nsfw(self, ctx):
@commands.cooldown(rate=1, per=5, type=commands.BucketType.member)
async def gay(self, ctx, user: discord.User = None):
if user:

r = requests.get(
"https://some-random-api.ml/canvas/gay?avatar=" + user.avatar.url
)
Expand All @@ -183,7 +176,6 @@ async def gay(self, ctx, user: discord.User = None):
@commands.cooldown(rate=1, per=5, type=commands.BucketType.member)
async def wasted(self, ctx, user: discord.User = None):
if user:

r = requests.get(
"https://some-random-api.ml/canvas/wasted?avatar=" + user.avatar.url
)
Expand All @@ -200,7 +192,6 @@ async def wasted(self, ctx, user: discord.User = None):
@commands.cooldown(rate=1, per=5, type=commands.BucketType.member)
async def triggered(self, ctx, user: discord.User = None):
if user:

r = requests.get(
"https://some-random-api.ml/canvas/triggered?avatar=" + user.avatar.url
)
Expand Down
2 changes: 0 additions & 2 deletions cogs/mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ async def mute(self, ctx, user: discord.Member, *, args):

print(data)
for a in data:

if a.endswith("m"):
minutes = int(a[:-1])
if a.endswith("s"):
Expand Down Expand Up @@ -105,7 +104,6 @@ async def warnings(self, ctx, user: discord.User):

@commands.command()
async def purge(self, ctx, limit: int = 2):

await ctx.channel.purge(limit=limit + 1)
time.sleep(1)
await ctx.send(f"Deleted {limit} messages", delete_after=2)
Expand Down
1 change: 0 additions & 1 deletion cogs/owner.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def cleanup_code(self, content):
@commands.command()
@commands.is_owner()
async def cogs(self, ctx):

emb = discord.Embed(
title="Loaded cogs",
description=":white_check_mark: :: "
Expand Down
4 changes: 0 additions & 4 deletions cogs/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,17 @@ def __init__(self, bot):
self.send_announcements_corriere.start()

def cog_unload(self):

self.send_announcements_corriere.cancel()
self.send_announcements.cancel()

@tasks.loop(minutes=1)
async def send_announcements(self):

fil = open("articles.json", "w")
feed = feedparser.parse(self.rss_url)

entry = feed.entries[0]

if entry["title"] in self.articles:

fil.write(json.dumps(self.articles))
fil.close()
return
Expand All @@ -50,7 +47,6 @@ async def send_announcements(self):

@tasks.loop(minutes=1)
async def send_announcements_corriere(self):

corriere = feedparser.parse(self.corriere_url)
cor = corriere.entries[0]
print("a")
Expand Down
2 changes: 0 additions & 2 deletions cogs/share.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ async def download(self, ctx, filename):
await ctx.author.send(file=discord.File("data/files/" + filename))

else:

await ctx.send("File not found. Try with a different file")
await self.staff_chat.send(
f"{ctx.author.mention} has attempted to download a file that does not exist."
Expand Down Expand Up @@ -135,7 +134,6 @@ async def staff(self, ctx):
for member in (
self.bot.get_guild(838727867428765766).get_role(884453174839230464).members
):

desc += f"{member.mention}\n"
emb = discord.Embed(title="Staff", description=desc)
await ctx.send(embed=emb)
Expand Down
2 changes: 0 additions & 2 deletions cogs/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def __init__(self, bot):
description="List tags",
)
async def tag(self, ctx, name=None):

cur = await self.con.cursor()

tags = ""
Expand All @@ -33,7 +32,6 @@ async def tag(self, ctx, name=None):
await cur.execute(f"SELECT * from tags WHERE name = '{name}'")
data = await cur.fetchall()
for a in data:

emb = discord.Embed(
title=f"Tag {name}",
description=a[1],
Expand Down
5 changes: 1 addition & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(self):
ending_note = f"(C) 2022 Il BaracchinoDella Scuola"

async def on_ready(self):

print("Running. Printing wd")
os.system("pwd")
self.staff_chat = self.get_channel(907937553343209472)
Expand All @@ -49,10 +48,8 @@ async def on_ready(self):
print("No sql for you, sorry")

for a in os.listdir("./cogs"):

try:
if a.endswith(".py"):

await self.load_extension("cogs." + a[:-3])
print(f"Loading {a[:-3]}.py")

Expand All @@ -70,7 +67,7 @@ async def on_ready(self):
activity=discord.Game(
name=random.choice(
[
"CopyRush 2022",
"CopyRush 2023",
"Games at school",
"Destroy the school",
"Fake the test",
Expand Down
10 changes: 6 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
aiohttp==3.8.1
aiohttp==3.8.6
aiomysql==0.0.22
aiosignal==1.2.0
astunparse==1.6.3
async-timeout==4.0.2
attrs==21.4.0
braceexpand==0.1.7
certifi==2021.10.8
certifi==2023.7.22
charset-normalizer==2.0.12
click==8.1.2
git+https://github.com/iDevision/enhanced-discord.py/
feedparser==6.0.8
jishaku==2.4.0
pet-pet-gif==1.0.2
Pillow==9.2.0
Pillow==10.0.1
pyfiglet==0.8.post1
PyMySQL==0.9.3
python-dotenv==0.20.0
requests==2.27.1
requests==2.31.0
youtube-dl==2021.12.17
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability
wheel>=0.38.0 # not directly required, pinned by Snyk to avoid a vulnerability
1 change: 0 additions & 1 deletion webhooks_ghost.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

@app.route("/receive", methods=["GET", "POST"])
def receive_hook():

data = json.loads(request.data)
webhook = DiscordWebhook(url=os.environ["WEBHOOK"])

Expand Down

0 comments on commit b5dd973

Please sign in to comment.