Pin, without votes to see where it goes

Fixes #23
pull/36/head
Stijn De Clercq 2021-02-08 18:46:15 +01:00
parent afca7bb451
commit 0c83472287
5 changed files with 15 additions and 7 deletions

View File

@ -114,6 +114,8 @@ class Events(commands.Cog):
# Someone forgot an argument or passed an invalid argument # Someone forgot an argument or passed an invalid argument
elif isinstance(err, (commands.BadArgument, commands.MissingRequiredArgument)): elif isinstance(err, (commands.BadArgument, commands.MissingRequiredArgument)):
await ctx.send("Controleer je argumenten.") await ctx.send("Controleer je argumenten.")
elif isinstance(err, commands.MessageNotFound):
await ctx.send("Geen bericht gevonden dat overeenkomt met het opgegeven argument.")
else: else:
# Remove the InvokeCommandError because it's useless information # Remove the InvokeCommandError because it's useless information
x = traceback.format_exception(type(err), err, err.__traceback__) x = traceback.format_exception(type(err), err, err.__traceback__)

View File

@ -84,6 +84,18 @@ class School(commands.Cog):
schedule.append(val) schedule.append(val)
return schedule 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): def setup(client):
client.add_cog(School(client)) client.add_cog(School(client))

View File

@ -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 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 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 ### poke
Used in poke.py - Poke commands. Keeps track of the currently poked person. Used in poke.py - Poke commands. Keeps track of the currently poked person.

View File

@ -68,6 +68,7 @@
"muttn": "Kiekt oeveel van ne muttn da [@Persoon] wel nie es aje eenen tagt, anders ist uzelf.", "muttn": "Kiekt oeveel van ne muttn da [@Persoon] wel nie es aje eenen tagt, anders ist uzelf.",
"neck": "<:WhatDidYou:744476950654877756><:DoTo:744476965951504414><:MyDrink:744476979939508275>", "neck": "<:WhatDidYou:744476950654877756><:DoTo:744476965951504414><:MyDrink:744476979939508275>",
"nightly": "Daily is overrated.\nClaim jouw dagelijkse bonus Didier Dinks.", "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.", "pjoke": "Didier vertelt een programming joke.",
"poke": "Tik [Persoon].", "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).", "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).",