Why am I getting this error: Ignoring exception in command None: discord.ext.commands.errors.CommandNotFound: Command "Test" is not found
I saw other posts about this but the problem was them either not having their token or the bot.run(TOKEN) at the bottom
*EDIT Here's the updated code, still get the same error
import discord
from dotenv import load_dotenv
from discord.ext import commands
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')
bot = commands.Bot(command_prefix='$', case_insensitive=True)
@bot.event
async def on_ready():
for guild in bot.guilds:
if guild.name == GUILD:
break
print(
f'{bot.user} is connected to the following guild:\n'
f'{guild.name}(id: {guild.id})'
)
@bot.command()
async def on_message(ctx, arg):
if ctx.author == bot.user:
return
if ctx.content.startswith('hello'):
await ctx.channel.send(arg)
bot.run(TOKEN)
bot.run(TOKEN)
case_insensitiveto True when instantiating theBotcase_insensitiveand it still doesn't work.