Skip to content

Parameters #27

May 27, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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:

import discord
from discord.ext import commands

bot = commands.Bot(command_prefix='PREFIX', description=description, intents=intents)

@bot.event
async def on_ready(self):
        print("Logged in: " + str(self.user))


@bot.command
async def help(ctx, *args_passed: str):    
        for a in args_passed:
                print(a)

bot.run('TOKEN')

The message PREFIXhelp 1 2 "hello world" 3 will print you:

1
2
hello world
3

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@destroyace
Comment options

Answer selected by dolfies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants