mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Automatically join threads, add placeholder code for pin context menu
This commit is contained in:
parent
93ede132a2
commit
9a999fb34b
3 changed files with 39 additions and 1 deletions
32
cogs/context_menus/school_cm.py
Normal file
32
cogs/context_menus/school_cm.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import discord
|
||||
from discord import ApplicationContext
|
||||
from discord.ext import commands
|
||||
from discord.commands import message_command
|
||||
|
||||
from startup.didier import Didier
|
||||
|
||||
|
||||
class SchoolCM(commands.Cog):
|
||||
def __init__(self, client: Didier):
|
||||
self.client: Didier = client
|
||||
|
||||
@message_command(name="Pin")
|
||||
async def _pin_cm(self, ctx: ApplicationContext, message: discord.Message):
|
||||
# In case people abuse, check if they're blacklisted
|
||||
blacklist = []
|
||||
|
||||
if ctx.user.id in blacklist:
|
||||
return await ctx.respond(":angry:", ephemeral=True)
|
||||
|
||||
if message.is_system():
|
||||
return await ctx.respond("Dus jij wil system messages pinnen?\nMag niet.", ephemeral=True)
|
||||
|
||||
await message.pin(reason=f"Didier Pin door {ctx.user.display_name}")
|
||||
await ctx.respond("📌", ephemeral=True)
|
||||
|
||||
|
||||
def setup(client: Didier):
|
||||
# client.add_cog(SchoolCM(client))
|
||||
# TODO wait for bug to be fixed in lib then uncomment this
|
||||
# when used in dm, tries to create a DM with the bot?
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue