Answer the question
In order to leave comments, you need to log in
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>, создан новый тикет!")
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