diff --git a/cogs/carbon.py b/cogs/carbon.py index 88852c6..406e9d2 100644 --- a/cogs/carbon.py +++ b/cogs/carbon.py @@ -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) diff --git a/cogs/errors.py b/cogs/errors.py index 20ced06..1f75602 100644 --- a/cogs/errors.py +++ b/cogs/errors.py @@ -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") @@ -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") diff --git a/cogs/events.py b/cogs/events.py index ba7c62f..7769a59 100644 --- a/cogs/events.py +++ b/cogs/events.py @@ -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() diff --git a/cogs/misc.py b/cogs/misc.py index 7846daa..0e1b9f0 100644 --- a/cogs/misc.py +++ b/cogs/misc.py @@ -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: @@ -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 ) @@ -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 ) @@ -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 ) @@ -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( @@ -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") ) @@ -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 ) @@ -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 ) @@ -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 ) diff --git a/cogs/mod.py b/cogs/mod.py index effd46f..066a646 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -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"): @@ -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) diff --git a/cogs/owner.py b/cogs/owner.py index 224625a..b2ca52d 100644 --- a/cogs/owner.py +++ b/cogs/owner.py @@ -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: :: " diff --git a/cogs/rss.py b/cogs/rss.py index f14563a..086d2a6 100644 --- a/cogs/rss.py +++ b/cogs/rss.py @@ -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 @@ -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") diff --git a/cogs/share.py b/cogs/share.py index cd26d94..0e58085 100644 --- a/cogs/share.py +++ b/cogs/share.py @@ -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." @@ -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) diff --git a/cogs/tags.py b/cogs/tags.py index adba693..48fa626 100644 --- a/cogs/tags.py +++ b/cogs/tags.py @@ -14,7 +14,6 @@ def __init__(self, bot): description="List tags", ) async def tag(self, ctx, name=None): - cur = await self.con.cursor() tags = "" @@ -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], diff --git a/main.py b/main.py index 2b94846..6ff230e 100644 --- a/main.py +++ b/main.py @@ -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) @@ -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") @@ -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", diff --git a/requirements.txt b/requirements.txt index 8586006..4987f95 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/webhooks_ghost.py b/webhooks_ghost.py index a1b6a1e..e814eaf 100644 --- a/webhooks_ghost.py +++ b/webhooks_ghost.py @@ -10,7 +10,6 @@ @app.route("/receive", methods=["GET", "POST"]) def receive_hook(): - data = json.loads(request.data) webhook = DiscordWebhook(url=os.environ["WEBHOOK"])