Skip to content

Commit

Permalink
events: ban commands from being sent in kurisu-development
Browse files Browse the repository at this point in the history
  • Loading branch information
lifehackerhansol committed May 12, 2023
1 parent ff20cf7 commit 5d1add7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cogs/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,13 @@ async def on_message(self, message: discord.Message):
self.bot.loop.create_task(self.user_ping_check(message))
self.bot.loop.create_task(self.user_spam_check(message))
self.bot.loop.create_task(self.channel_spam_check(message))
# check if message is a command and/or if message was sent in kurisu-dev
ctx = await self.bot.get_context(message)
if ctx.valid and message.channel == self.bot.channels['kurisu-development']:
# if so, shut them up
await message.delete()
await message.channel.send(f"{message.author.mention} Please use {self.bot.channels['bot-cmds'].mention} for commands.", delete_after=10)
return

@commands.Cog.listener()
async def on_message_edit(self, message_before: discord.Message, message_after: discord.Message):
Expand Down
2 changes: 1 addition & 1 deletion kurisu.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ async def load_channels(self):
'switch-assistance-1', 'switch-assistance-2', 'helpers', 'watch-logs', 'message-logs',
'upload-logs', 'hacking-general', 'meta', 'appeals', 'legacy-systems', 'dev', 'off-topic',
'voice-and-music', 'bot-cmds', 'bot-talk', 'mods', 'mod-mail', 'mod-logs', 'server-logs', 'bot-err',
'elsewhere', 'newcomers', 'nintendo-discussion', 'tech-talk', 'hardware', 'streaming-gamer']
'elsewhere', 'newcomers', 'nintendo-discussion', 'tech-talk', 'hardware', 'streaming-gamer', 'kurisu-development']

for n in channels:
db_channel = await self.configuration.get_channel_by_name(n)
Expand Down

0 comments on commit 5d1add7

Please sign in to comment.