Parameters #27
Answered
by
riccardolunardi
destroyace
asked this question in
Help
-
import discord class Client(discord.Client):
def __init__(self):
self.prefix = "PREFIX"
async def on_ready(self):
print("Logged in: " + str(self.user))
async def on_message(self, message):
# Single-user Check
if message.author != self.user:
return
# Template Command
if message.content.startswith(f"{self.prefix}help"):
await message.channel.send("Here to help!")
client = Client()
client.run("TOKEN") Given this code, how could one apply args to the help command so that a value could be passed in. |
Beta Was this translation helpful? Give feedback.
Answered by
riccardolunardi
May 30, 2021
Replies: 1 comment 1 reply
-
I suggest you to look for examples in the discord.py repo. Anyway, you should use the
The message
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dolfies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I suggest you to look for examples in the discord.py repo. Anyway, you should use the
discord.ext.commands
extension, since it's easier to handle commands.The example you posted I think should look like this:
The message
PREFIXhelp 1 2 "hello world" 3
will print you: