Commands not working
#6185
-
import discord
from discord.ext import commands
# Script variables
# Discord variables
client = discord.Client()
bot = commands.Bot(command_prefix='$')
# Client events
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@bot.command(name='test')
async def _test(ctx):
await ctx.send('Hello World!')
# Run the bot!
client.run('discord token') So far as I can see, I'm doing every correctly but it does now work. Can anyone help? |
Beta Was this translation helpful? Give feedback.
Answered by
Rapptz
Dec 22, 2020
Replies: 1 comment 1 reply
-
You're mixing both |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're mixing both
Client
andBot
. Only theBot
can process commands and already does everything aClient
can do, so just remove it from the code and useBot
throughout.