Discord.py: Command not found error

Created on 10 Jul 2018  路  12Comments  路  Source: Rapptz/discord.py

`import discord
from discord.ext.commands import Bot
import random
token = '*'
Bot_Prefix = ('!')

client = Bot(command_prefix=Bot_Prefix)

@client.command(name='dice')
async def dice_roll():
roll = ['1','2','3','4','5','6']

  await client.say(random.choice(roll))

client.run(token)
`
I was wondering if anyone could help me figure out why whenever I enter in the command !dice it tells me that the command dice is not found

question

All 12 comments

I'm unable to reproduce this. Are you sure this is the code you're running?

Ya I'm 100% sure it doesn't include the indents I didn't know how everyone else includes there code with all the highlights and indents

What I'm asking is if this is the exact code you're running, besides the token.
A simple copy + paste and token replacement works as anticipated.

As for GitHub code blocks, see: https://help.github.com/articles/creating-and-highlighting-code-blocks/

Ya it is the exact code im running

Are you restarting your bot after you've modified its code?
Unless you're using cogs, the bot doesn't dynamically update, so you have to stop and re-run it.

how exactly do I do that?

Stop execution of the Python script and start it again, the same way you did before.

This doesn't seem to be an issue with the library, so for further help, you should join either the official discord.py server or the Discord API server, as the README recommends.

ah alright thank you

It's really sad all of the issues with hold ups, due to rewriting and lack of proper instructions. How can people learn when nothing works )))

It is not a good idea to comment on old, closed issues. If you need help with anything to do with the library, follow the links above and ask there.

oh ok

As explained, please don't necrobump issues.
This is a closed issue which was a question about an issue caused by user error, not an issue with the library. There is thorough documentation for the library, along with a detailed guide for migrating to v1.0, and the library is fully functional.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AraHaan picture AraHaan  路  3Comments

Rimmy50 picture Rimmy50  路  3Comments

synbitz picture synbitz  路  3Comments

Spyder-exe picture Spyder-exe  路  3Comments

jzburda picture jzburda  路  3Comments