V
V
Vladislav Mukhin2021-02-14 18:47:23
Python
Vladislav Mukhin, 2021-02-14 18:47:23

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()


+ How to create Slash commands in discord.py?
PS: I read the documentation, it's difficult if there is a good example: I will be very grateful

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question