Answer the question
In order to leave comments, you need to log in
How to create a chat stop command in discord.py?
1.How to create a chat stop command in discord.py?
STOP_CHANNEL = 1
@Client.command()
@commands.is_owner()
async def stop(ctx):
global STOP_CHANNEL
STOP_CHANNEL = 1
@Client.command()
@commands.is_owner()
async def start(ctx):
global STOP_CHANNEL
STOP_CHANNEL = 0
@Client.event
async def on_message(message):
if STOP_CHANNEL:
if message.author.id != 458244468240547842:
await message.delete()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question