Search code examples
pythondiscordbots

How do I make a Discord bot send a message locally


I want it to look like this:

this.

I'm coding this Discord bot in Python. Can you tell the code to make it privately message you like this?

I'm expecting Python code that will send a message to you locally. When I asked ChatGPT, it came up with code to DM the user, I don't want that.


Solution

  • For example when you are using discord.py you can react to interaction "empheral" this way:

    async def test(interaction):
        await interaction.response.send_message(content="Test", ephemeral=True)