Я не понимаю эту ошибку. У меня 4 отступа.
Это мой код
import discord
import asyncio
from discord.ext import commands
TOKEN = "My Token bot here"
bot = commands.Bot(command_prefix="!")
@bot.event
async def on_ready():
print(bot.user.name)
print(bot.user.id)
@bot.command(pass_context=True)
async def anon(ctx,channel:discord.Channel,*,message:str):
if str(channel.type) != 'text':
return
footer='\nfrom {}'.format(ctx.message.channel.mention)
message+=footer
await bot.send_message(channel,message)
try:
bot.run(TOKEN)
except KeyboardInterrupt:
print("")
Я пытаюсь создать бота, который может выполнить команду, подобную этому / anon #channel message. Анонимный бот.