Pin, without votes to see where it goes

Fixes #23
This commit is contained in:
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
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__)

View file

@ -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))