Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events: ban commands from being sent in kurisu-development #1193

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cogs/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,13 @@ async def on_message(self, message: discord.Message):
# self.bot.loop.create_task(self.user_ping_check(message)) replaced by automod
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
3 changes: 2 additions & 1 deletion kurisu.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ 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', 'wii-vwii-assistance']
'elsewhere', 'newcomers', 'nintendo-discussion', 'tech-talk', 'hardware', 'streaming-gamer', 'wii-vwii-assistance',
'kurisu-development']

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