0

I've been trying for several hours to make the bot send an ephemeral message when writing the /info command in a channel that is only visible to me or to the user who uses it

https://github.com/Arion107/DiscordBot/blob/main/command.py

However, it sends a normal message visible to everyone and I don't know what's wrong, I would really appreciate the help

Arion107
  • 5
  • 1
  • Can you provide some more information? When you say `/info` is that an actual slash command or a command with a prefix? What python discord library are you using? Can you put the snippet of code inside the question please? – ESloman Feb 23 '23 at 16:55
  • In your [other question](https://stackoverflow.com/questions/75447209/how-can-i-make-a-discord-bot-when-warning-a-user-in-a-channel-only-the-user-can) it seems that you aren't using application commands but using a prefix. Therefore, you **won't** be able to send a message ephemerally _unless_ you are using application commands (or with another interaction). See [here](https://stackoverflow.com/questions/69074937/how-would-i-send-an-ephemeral-message-in-discord-py). If you are using application commands; edit your question accordingly and provide your code so that we can help you. – ESloman Feb 23 '23 at 16:59
  • I am using command with prefix https://github.com/Arion107/DiscordBot/blob/main/command.py – Arion107 Feb 23 '23 at 17:46
  • Then you won't be able to send ephemeral messages. You can _only_ send ephemeral messages as a response to an interaction. An interaction is a user using an application command or pressing a UI component. – ESloman Feb 23 '23 at 20:13
  • Please provide enough code so others can better understand or reproduce the problem. – Community Mar 01 '23 at 08:21

1 Answers1

0

Ephemeral messages are only allowed use through the interaction.send_message() function which is an application command. You will have to recode your bot for application commands not bot.commands.

See this for help setting up app commands:

How do i make a working slash command in discord.py

Chris Sanchez
  • 135
  • 1
  • 7