E
E
Evgeny Kucher2021-02-12 18:23:58
Python
Evgeny Kucher, 2021-02-12 18:23:58

How to break code in discord.py?

Hi, how to interrupt code execution in discord.py?
Here is the code itself:

@client.command()
async def call(ctx):
    await ctx.channel.purge(limit = 1)
    name = f'{ctx.message.author}'
    name = name.replace("#","")

    for channel in client.get_guild(803887522379857972).channels:
        if channel.name == name:
            await ctx.send(f"{ctx.author.mention}, вы уже создали обращение!")
            await asyncio.sleep(5)
            await ctx.channel.purge(limit = 1)
    guild = ctx.message.guild
    category = client.get_channel(809737986388000788)
    overwrites = {
        ctx.guild.default_role: discord.PermissionOverwrite(read_messages = False),
        ctx.author: discord.PermissionOverwrite(read_messages = True, send_messages = True)
    }
    await guild.create_text_channel(name, overwrites = overwrites, category = category)

    channel = client.get_channel(809736599377281044)
    await channel.send("<@250690533285036032>, создан новый тикет!")

I will be very grateful

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2021-02-12
@Lionex

basic concepts of python

K
Kilisami, 2021-02-12
@Kilisami

CTRL+C

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question