I don't understand this error. I have 4 spaces indentation.
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("")
I try to make bot who can do a command like this /anon #channel message. An anonyme bot.