Skip to content

Commit 834ccb2

Browse files
events: ban commands from being sent in kurisu-development
1 parent 4ef2c68 commit 834ccb2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

cogs/events.py

+7
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,13 @@ async def on_message(self, message: discord.Message):
437437
# self.bot.loop.create_task(self.user_ping_check(message)) replaced by automod
438438
self.bot.loop.create_task(self.user_spam_check(message))
439439
self.bot.loop.create_task(self.channel_spam_check(message))
440+
# check if message is a command and/or if message was sent in kurisu-dev
441+
ctx = await self.bot.get_context(message)
442+
if ctx.valid and message.channel == self.bot.channels['kurisu-development']:
443+
# if so, shut them up
444+
await message.delete()
445+
await message.channel.send(f"{message.author.mention} Please use {self.bot.channels['bot-cmds'].mention} for commands.", delete_after=10)
446+
return
440447

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

kurisu.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ async def load_channels(self):
278278
'switch-assistance-1', 'switch-assistance-2', 'helpers', 'watch-logs', 'message-logs',
279279
'upload-logs', 'hacking-general', 'meta', 'appeals', 'legacy-systems', 'dev', 'off-topic',
280280
'voice-and-music', 'bot-cmds', 'bot-talk', 'mods', 'mod-mail', 'mod-logs', 'server-logs', 'bot-err',
281-
'elsewhere', 'newcomers', 'nintendo-discussion', 'tech-talk', 'hardware', 'streaming-gamer', 'wii-vwii-assistance']
281+
'elsewhere', 'newcomers', 'nintendo-discussion', 'tech-talk', 'hardware', 'streaming-gamer', 'wii-vwii-assistance',
282+
'kurisu-development']
282283

283284
for n in channels:
284285
db_channel = await self.configuration.get_channel_by_name(n)

0 commit comments

Comments
 (0)