Skip to content

Commit 88b33ed

Browse files
events: ban commands from being sent in kurisu-development
1 parent 9be7ccf commit 88b33ed

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cogs/events.py

+7
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,13 @@ async def on_message(self, message: discord.Message):
427427
self.bot.loop.create_task(self.user_ping_check(message))
428428
self.bot.loop.create_task(self.user_spam_check(message))
429429
self.bot.loop.create_task(self.channel_spam_check(message))
430+
# check if message is a command and/or if message was sent in kurisu-dev
431+
ctx = await self.bot.get_context(message)
432+
if ctx.valid and message.channel == self.bot.channels['kurisu-development']:
433+
# if so, shut them up
434+
await message.delete()
435+
await message.channel.send(f"{message.author.mention} Please use {self.bot.channels['bot-cmds'].mention} for commands.", delete_after=10)
436+
return
430437

431438
@commands.Cog.listener()
432439
async def on_message_edit(self, message_before: discord.Message, message_after: discord.Message):

kurisu.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ async def load_channels(self):
270270
'switch-assistance-1', 'switch-assistance-2', 'helpers', 'watch-logs', 'message-logs',
271271
'upload-logs', 'hacking-general', 'meta', 'appeals', 'legacy-systems', 'dev', 'off-topic',
272272
'voice-and-music', 'bot-cmds', 'bot-talk', 'mods', 'mod-mail', 'mod-logs', 'server-logs', 'bot-err',
273-
'elsewhere', 'newcomers', 'nintendo-discussion', 'tech-talk', 'hardware', 'streaming-gamer', 'wii-assistance']
273+
'elsewhere', 'newcomers', 'nintendo-discussion', 'tech-talk', 'hardware', 'streaming-gamer', 'kurisu-development']
274274

275275
for n in channels:
276276
db_channel = await self.configuration.get_channel_by_name(n)

0 commit comments

Comments
 (0)