Ask coding questions

← Back to all posts
Discord bot
triodymium (0)

Line 15 and 16, I am trying to make the bot recognize that the command (which is !b blay) was done and it needs to take the link given afterwards and send it back. Right now it only recognizes '!b blay {link}' and sends '{link}' back.

Answered by ryanbrwr (33) [earned 5 cycles]
View Answer
Comments
hotnewtop
ryanbrwr (33)

You could try something like

if message.content.startswith('!b blay'): temp = message.content.split(' ') await message.channel.send(temp[len(temp) -1])

triodymium (0)

@ryanbrwr That worked perfectly thank you!

ryanbrwr (33)

@triodymium No prob! Glad I could help you out, if you think it's the correct answer then you can accept it so other people having this problem can solve it too!