I want to send a message which uses the message content
If a user writes !alcool
, for example, I want my bot to answer textealcool.png
If they write !car
, I want textecar.png
.
My code is :
from discord.ext.commands import Bot
BOT_PREFIX = ("!")
TOKEN = "XXXXXX"
client = Bot(command_prefix=BOT_PREFIX)
@client.event
async def on_message(message):
if message.content.startswith("!"):
newMessage = 'texte' + str(message.content)[1:] + '.png'
await client.send_message(message.channel, newMessage)
client.run(TOKEN)
I wrote "!alcool" but my Bot answered with :
textealcool
texte!alcool
textealcool
texte
textealcool.pgn
textealcool.pgn
textealcool
textealcool.pgn
textealcool
I don't understand why I have so many answers with only two are right.