bwmarrin / discordgo

(Golang) Go bindings for Discord
BSD 3-Clause "New" or "Revised" License
5.05k stars 802 forks source link

When editing a message, does it support changing the message to be visible only to the current user? #1490

Closed houxul closed 8 months ago

houxul commented 8 months ago
       msgEdit := &discordgo.MessageEdit{
        Channel: message.ChannelId,
        ID:      message.MessageId,
        Content: &content,
        Flags:   discordgo.MessageFlagsEphemeral,
    }
    _, err := s.sess.ChannelMessageEditComplex(msgEdit)

Call the above code and set Flags to discordgo.MessageFlagsEphemeral, when the message has not changed to be visible only to the current user. The following is the definition of MessageFlagsEphemeral. https://github.com/bwmarrin/discordgo/blob/master/message.go#L212-L213

FedorLap2006 commented 8 months ago

MessageFlagsEphemeral cannot be set when editing a message. In addition to that, it is only available when responding to an interaction.