bwmarrin / discordgo

(Golang) Go bindings for Discord
BSD 3-Clause "New" or "Revised" License
5.11k stars 813 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 9 months ago

houxul commented 9 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 9 months ago

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