N
N
NeoLight32020-08-03 16:50:48
Python
NeoLight3, 2020-08-03 16:50:48

How to get multiple client parameters when calling a command in Discord?

Discord has an arg parameter when registering a team:

@client.command(pass_context = True)
async def test(ctx,arg):
  await ctx.send(arg[0])

When trying to get 1 arg parameter, returns 1 parameter character.
That is, there is not a string-array, but just a string.

Is it possible to somehow receive several parameters at once when calling the command?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2020-08-03
@NeoLight3

Of course, because arg is a string, arg[0] is the first character of this string. Correct: Then arg will be an array and arg[0] will return the first element of the array.
async def test(ctx, *arg):

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question