Ask coding questions

← Back to all posts
Why my discord Bot doesn't recognize the prefix command.
h
CoderConda (0)

Could someone help that how to get prefix commands to work in python code, as far as myself I don't know

Comments
hotnewtop
cuber1515 (90)

client = commands.Bot(command_prefix = '-') should work but replace client with the name of the variable the is assigned to discord.Client()
so for example

client = discord.Client()

#bot prefix

client = commands.Bot(command_prefix = '-')
CoderConda (0)

@cuber1515 want to come help me i can put an invitation link?

CoderConda (0)

@cuber1515 I now sent an invitation

cuber1515 (90)

wait did you delete the repl @CoderConda

CoderConda (0)

@cuber1515 I deleted it because I created a new bot and I have now made it work fine

CoderConda (0)

@cuber1515 Hi would you like to help me with one thing yet?

CoderConda (0)

@cuber1515 okay i put invin so open chat so i tell you how i would like that cood to work

CoderConda (0)

@cuber1515 Are you going to help with that code now

CoderConda (0)

@cuber1515 sorry i didn't notice you were in live chat but can you now come see that code if you got it done?

CoderConda (0)

@cuber1515 hey can you help a little more i put in the invin bot

titancomeback (0)

whats the benifit of boosting a bot ?

InvisibleOne (3197)

Could you make your repl public or invite me to it

CoderConda (0)

@InvisibleOne I now sent you an invite linkedin

InvisibleOne (3197)

ah, I think it's just bot = commands.Bot(prefix="prefix") @CoderConda

InvisibleOne (3197)

Never mind, I fixed it in the code, it should be running now.

CoderConda (0)

@InvisibleOne see code error. not work line 17