diff --git a/cogs/events.py b/cogs/events.py index debaac8..009e880 100644 --- a/cogs/events.py +++ b/cogs/events.py @@ -114,6 +114,8 @@ class Events(commands.Cog): # Someone forgot an argument or passed an invalid argument elif isinstance(err, (commands.BadArgument, commands.MissingRequiredArgument)): await ctx.send("Controleer je argumenten.") + elif isinstance(err, commands.MessageNotFound): + await ctx.send("Geen bericht gevonden dat overeenkomt met het opgegeven argument.") else: # Remove the InvokeCommandError because it's useless information x = traceback.format_exception(type(err), err, err.__traceback__) diff --git a/cogs/school.py b/cogs/school.py index 8c6445c..e0834c7 100644 --- a/cogs/school.py +++ b/cogs/school.py @@ -84,6 +84,18 @@ class School(commands.Cog): schedule.append(val) return schedule + @commands.command(name="Pin", usage="[Message]") + @help.Category(category=Category.School) + async def pin(self, ctx, message: discord.Message): + # In case people abuse, check if they're blacklisted + blacklist = [] + + if ctx.author.id in blacklist: + return + + await ctx.message.add_reaction("✅") + await message.pin(reason="Didier Pin door {}".format(ctx.author.display_name)) + def setup(client): client.add_cog(School(client)) diff --git a/databases.md b/databases.md index 14fcc1e..1e42101 100644 --- a/databases.md +++ b/databases.md @@ -123,13 +123,6 @@ Used in stats.py - Stats commands. Tracks the user's personal stats to award ach 12 xp: bigint, default 0 | The amount of message xp the user has gained 13 last_message: bigint, default 0 | The timestamp of the user's last message that awarded xp -### pin - -Used in school.py - Pin command. Keeps track of which messages have been requested for a pin. - - 0 messageid: bigint, unique, primary key | The id of the message being tracked - 1 reactions: integer, default 0 | The amount of votes for this message - ### poke Used in poke.py - Poke commands. Keeps track of the currently poked person. diff --git a/files/help.json b/files/help.json index 41f088d..09f640e 100644 --- a/files/help.json +++ b/files/help.json @@ -68,6 +68,7 @@ "muttn": "Kiekt oeveel van ne muttn da [@Persoon] wel nie es aje eenen tagt, anders ist uzelf.", "neck": "<:WhatDidYou:744476950654877756><:DoTo:744476965951504414><:MyDrink:744476979939508275>", "nightly": "Daily is overrated.\nClaim jouw dagelijkse bonus Didier Dinks.", + "pin": "Pin [Message] zodat je geen admins hoeft te pingen. Misbruik kan je blacklisten.", "pjoke": "Didier vertelt een programming joke.", "poke": "Tik [Persoon].", "poke blacklist": "Indien je liever niet aan Poke wil deelnemen, kan je jezelf op deze manier blacklisten.\nIndien je jezelf wil ont-blacklisten stuur je een DM naar DJ STIJN (om misbruik tegen te gaan).", diff --git a/functions/database/pin.py b/functions/database/pin.py deleted file mode 100644 index e69de29..0000000