N
N
Nekit Strelok2021-09-10 09:15:07
Python
Nekit Strelok, 2021-09-10 09:15:07

How to display the entire message?

How to display the entire message? Like $message 136384993 3828191 2223.44 5 4
And I need to output everything after $message
How can I do that?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Nevzorov, 2021-09-10
@Dikobrazka

Use command extension

@bot.command()
async def message(ctx, *, text: str): # https://discordpy.readthedocs.io/en/stable/ext/commands/commands.html#keyword-only-arguments
     """Send <text>"""
     await ctx.send(text)

S
Sergey Karbivnichy, 2021-09-10
@hottabxp

Option 1:

message = '$message 136384993 3828191 2223.44 5 4'
print(message[9:])

Option 2:
message = '$message 136384993 3828191 2223.44 5 4'
print(message.replace('$message ',''))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question