Search code examples
pythondiscordbots

Discord.py bot - how to make bot copy my message


I'm developing in Python. I'd like to make my bot copying the previous message, which contains a special command for this.

For example, I type the command say. So it would look like this:

Me: say What are you doing?

Bot: What are you doing?


Solution

  • @bot.listen()
    async def on_message(message):
        if message.content.startswith("!say"):
            await message.channel.send(message.content)