tl;dr How can my bot asynchronously wait for reactions on multiple messages? I’m adding a rock-paper-scissors (rps) command to my Discord bot. Users can invoke the command can be invoked by entering .rps along with an optional parameter, specifying a user to play with. When invoked, the bot will direct-message (DM) the user who invoked it and the target user
Tag: discord.py
discord.py – How can I have 2 arguments in a command?
just wondering how an I have 2 arguments, for example Like “arg1” and “arg2” Example: Answer For 2 args as 2 separate variables you could do something like this Or if you want to send all args passed as a list you could do… as per the rewrite documentation: Or if you want to send everything as one argument you
Print online users to console, Discord.py
When I execute the command using my current code, I get the error NameError: name ‘offline’ is not defined. I can’t find the correct variables to make it work properly. Answer According to the API reference, you could use PS. I know nothing about this library, yet I tried searching the docs. Give it a try from now on :)
How to make a command case insensitive in discord.py
How would one make a command case-insensitive without adding many aliases for different capitalizations like this: Answer On the rewrite branch, commands.Bot accepts a case_insensitive parameter Note that there is a performance loss when using this feature.
Finding author of a message
If someone writes “?name (arg)” I want my bot to say the author of the message + “, your name is” + arg. I can’t find of the author of the message though. Answer To get the name of the author of the message, you will need to use context
How to remove or change the default help command?
How do you remove or at least change the format of the default help command in discord.py? I think changing the format would be nice, I don’t really like the format at all. Answer Try this: Put this at the top of your code, after your imports. Then create your own. Or to format it check this out: Click here!