@@ -111,13 +111,23 @@ func HandleCoopStatusPermissionButton(s *discordgo.Session, i *discordgo.Interac
111111 customID := i .MessageComponentData ().CustomID
112112 respondAndClose := func (content string ) {
113113 err := s .InteractionRespond (i .Interaction , & discordgo.InteractionResponse {
114- Type : discordgo .InteractionResponseUpdateMessage ,
114+ Type : discordgo .InteractionResponseDeferredMessageUpdate ,
115115 Data : & discordgo.InteractionResponseData {
116- Content : content ,
117116 Flags : discordgo .MessageFlagsEphemeral ,
118117 Components : []discordgo.MessageComponent {},
119118 },
120119 })
120+ if err != nil {
121+ log .Println ("Error acknowledging coop status permission dialog:" , err )
122+ return
123+ }
124+
125+ emptyComponents := []discordgo.MessageComponent {}
126+ edit := discordgo.WebhookEdit {
127+ Content : & content ,
128+ Components : & emptyComponents ,
129+ }
130+ _ , err = s .FollowupMessageEdit (i .Interaction , i .Message .ID , & edit )
121131 if err != nil {
122132 log .Println ("Error updating coop status permission dialog:" , err )
123133 }
@@ -146,6 +156,6 @@ func HandleCoopStatusPermissionButton(s *discordgo.Session, i *discordgo.Interac
146156 respondAndClose ("Permission granted for 7 days. You can now run your command again." )
147157
148158 case "close" :
149- respondAndClose ("Dialog closed. You can enable this permission later when you're ready. " )
159+ respondAndClose ("I understand " )
150160 }
151161}
0 commit comments