DevER-M
DevER-M

Reputation: 43

Send reply which is not visible to others in discord.py

So i want something like this enter image description here

But when i try to do ctx.reply("replied") it is seen by everyone how to do it like the above image?

Upvotes: 0

Views: 1743

Answers (2)

BatteTarte
BatteTarte

Reputation: 59

I suggest you to use pycord

so you can easily create slash command and ephemeral

pip install pycord

pip uninstall discord.py

import discord
from discord.ext import commands
intents = discord.Intents().all()

bot = commands.Bot(intents=intents)

@bot.slash_command()
async def mycommand(ctx):
    await ctx.reply("hello i'm an hidded message",ephemeral=True)

bot.run("your bot token")

Upvotes: 0

Ratery
Ratery

Reputation: 2917

You can send ephemeral messages only as response to interaction (slash command or component like button or select). If you want to create a slash commands you need to use discord.py forks or extension for it:

Or new APIs for python:

Upvotes: 3

Related Questions