I am writing a simple discord bot for fun, and i want it to take (for example) a number from a message after certain phrase and use it later for example a certain user types "$test 6" and i want my bot to take that number ( 6 ) and for another example send it to the same channel.
i came up after creating this question to split the message.content will it work? (not counting that the user could write something else than numbers)
import discord
client = discord.Client()
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith("$test"):
stringOne = str(message.content)
stringTwo = "$test "
split = stringOne.partition(stringTwo)[2]
await message.channel.send("number/s from your message: " + split)