Код:
@bot.command(name='ticket')
async def _ticket(ctx, number=None):
if not number:
return await ctx.reply(embed=discord.Embed(title="А какая тема тикета то?",description="Все тикеты:\n1-Набор на модератора\n2-Другая причина(Когда канал будет создан, вы должны указать тему)"))
if number == "1":
cat = discord.utils.get(ctx.guild.categories, name="tickets")
channel = await ctx.guild.create_text_channel(f"ticket-{ctx.author.name}", category=cat)
await channel.send(f"{ctx.author.mention} Тикет создан!")
await channel.set_permissions(ctx.author, speak=True, send_messages=True, read_message_history=True, read_messages=True)
return await ctx.message.delete()
if number == "2":
cat = discord.utils.get(ctx.guild.categories, name="tickets")
channel = await ctx.guild.create_text_channel(f"ticket-{ctx.author.name}", category=cat)
await channel.send(f"{ctx.author.mention} Укажи тему тикета!")
await channel.set_permissions(ctx.author, speak=True, send_messages=True, read_message_history=True, read_messages=True)
return await ctx.message.delete()
else:
return await ctx.reply(embed=discord.Embed(title="А какая тема тикета то?",description="Все тикеты:\n1-Набор на модератора\n2-Другая причина(Когда канал будет создан, вы должны указать тему)"))
Ошибка:
C:\Users\shits>cd Desktop
C:\Users\shits\Desktop>python Ticki_bot.py
File "C:\Users\shits\Desktop\Ticki_bot.py", line 14
await channel.set_permissions(ctx.author,
TabError: inconsistent use of tabs and spaces in indentation
C:\Users\shits\Desktop>python Ticki_bot.py
File "C:\Users\shits\Desktop\Ticki_bot.py", line 14
await channel.set_permissions(ctx.author,
TabError: inconsistent use of tabs and spaces in indentation
C:\Users\shits\Desktop>python Ticki_bot.py
File "C:\Users\shits\Desktop\Ticki_bot.py", line 14
await channel.set_permissions(ctx.author, speak=True, send_messages=True, read_message_history=True, read_messages=True)
TabError: inconsistent use of tabs and spaces in indentation
C:\Users\shits\Desktop>python Ticki_bot.py
File "C:\Users\shits\Desktop\Ticki_bot.py", line 14
await channel.set_permissions(ctx.author, speak=True, send_messages=True, read_message_history=True, read_messages=True)
TabError: inconsistent use of tabs and spaces in indentation