0

I don't understand this error. I have 4 spaces indentation.

It's my code

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.

  • 1
    you may want to double check that you dont have a rogue tab somewhere, you can set whitespace to be displayed by looking [here](https://stackoverflow.com/q/30140595/7540911) – Nullman Jan 19 '20 at 12:12
  • remove (cut) some lines around the error line, hoping you'll find what line really is the problem. It may not be the exact one listed in the error message... – B. Go Jan 19 '20 at 19:39

0 Answers0