Skip to content
Advertisement

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 :)

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!

Advertisement