Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
48

Discord Commands

ReshiramWolfu
ReshiramWolfu

I want to make a discord bot respond to commands, and i have this code so far, can anyone help me do a command so that it will respond to anything after an exclamation mark, like this !respond
https://repl.it/@ReshiramWolfu/Alter-Ego-Bot-Discord

4 years ago

Voters

Comments

TopNew
2
TheDrone7
TheDrone7

I might not be able to help you with something like that, since all you need to do is add a little logic, I can provide you with a few links for reference though: -
Discord.py documentation - http://discordpy.readthedocs.io/en/async/
A tutorial: https://pythonprogramming.net/discordpy-basic-bot-tutorial-introduction/
( This is part 1 that you've probably already completed. Still you should go through it.)
Part 2 is what you really need - https://pythonprogramming.net/building-bot-commands-discordpy-bot-tutorial/?completed=/discordpy-basic-bot-tutorial-introduction/

You might also want to go through this if you're planning to keep your bot on repl.it - https://repl.it/talk/learn/Hosting-discordpy-bots-with-replit/11008

Also, you are using discord.py-async , I recommend shifting to discord.py-rewrite, it's newer and already better than discord.py-async in many aspects and is also being improved!

4 years ago
1
ChristinaSchw
ChristinaSchw

Constants are a https://chinesebuffetnearmenow.net/ special type of variable. Once declared, the value cannot be changed (unless you change the value when initializing it). In JS you use the const keyword: const pi = 3.14159

5 months ago
1
Textcrafter101
Textcrafter101

you could do something like this:
if message.content.startswith('!'): (for some reason it wouldn't let me go to the next line) await message.channel.send('this is where the stuff you want it to say would be')
if this helps, please upvote, though you've probably already gotten an answer since this was from 3 years ago

9 months ago
1
xnfdeveloper
xnfdeveloper

eample if (message.content.startsWith('beep')) {
message.channel.send('Boop.');
}

2 years ago
Load more