Discord Bot not recognizing command names

  bots, command, discord, python

This is what I wrote just to start my discord bot, but whenever I try using the command ?hi, I get the error message

Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "hi" is not found"

I’ve tried a couple things but I am new at this and nothing is working.

import discord 
from discord.ext import commands, tasks 
import os 
import random 

client = commands.Bot(command_prefix = '?')

@client.command
async def hi(ctx):
  await ctx.send("Hello World")

Source: Python Questions

LEAVE A COMMENT