add block on any channel but skynet

pull/11/head
Konstantine Tsafatinos 2023-07-19 12:28:57 -04:00
parent 609c741ae9
commit 06827a0e70
2 changed files with 6 additions and 1 deletions

View File

@ -439,7 +439,7 @@ def telegram(
@run.command() @run.command()
@click.option('--loglevel', '-l', default='INFO', help='logging level') @click.option('--loglevel', '-l', default='INFO', help='logging level')
@click.option( @click.option(
'--account', '-a', default=None) '--account', '-a', default='discord')
@click.option( @click.option(
'--permission', '-p', default='active') '--permission', '-p', default='active')
@click.option( @click.option(

View File

@ -47,6 +47,11 @@ class DiscordBot(commands.Bot):
print(self.user.id) print(self.user.id)
print("==============") print("==============")
async def on_message(self, message):
if message.channel.name != 'skynet':
return
await self.process_commands(message)
async def on_command_error(self, ctx, error): async def on_command_error(self, ctx, error):
if isinstance(error, commands.MissingRequiredArgument): if isinstance(error, commands.MissingRequiredArgument):
await ctx.send('You missed a required argument, please try again.') await ctx.send('You missed a required argument, please try again.')