forked from pothtonswer/discordmuffin
make WebhookEdit fields pointers (#1174)
* make WebhookEdit fields pointers * fix examples
This commit is contained in:
parent
eab9aa5218
commit
c29e0d740f
2 changed files with 9 additions and 7 deletions
|
@ -476,10 +476,11 @@ var (
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
time.AfterFunc(time.Second*5, func() {
|
time.AfterFunc(time.Second*5, func() {
|
||||||
_, err = s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{
|
content := content + "\n\nWell, now you know how to create and edit responses. " +
|
||||||
Content: content + "\n\nWell, now you know how to create and edit responses. " +
|
|
||||||
"But you still don't know how to delete them... so... wait 10 seconds and this " +
|
"But you still don't know how to delete them... so... wait 10 seconds and this " +
|
||||||
"message will be deleted.",
|
"message will be deleted."
|
||||||
|
_, err = s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{
|
||||||
|
Content: &content,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.FollowupMessageCreate(i.Interaction, true, &discordgo.WebhookParams{
|
s.FollowupMessageCreate(i.Interaction, true, &discordgo.WebhookParams{
|
||||||
|
@ -517,8 +518,9 @@ var (
|
||||||
}
|
}
|
||||||
time.Sleep(time.Second * 5)
|
time.Sleep(time.Second * 5)
|
||||||
|
|
||||||
|
content := "Now the original message is gone and after 10 seconds this message will ~~self-destruct~~ be deleted."
|
||||||
s.FollowupMessageEdit(i.Interaction, msg.ID, &discordgo.WebhookEdit{
|
s.FollowupMessageEdit(i.Interaction, msg.ID, &discordgo.WebhookEdit{
|
||||||
Content: "Now the original message is gone and after 10 seconds this message will ~~self-destruct~~ be deleted.",
|
Content: &content,
|
||||||
})
|
})
|
||||||
|
|
||||||
time.Sleep(time.Second * 10)
|
time.Sleep(time.Second * 10)
|
||||||
|
|
|
@ -41,9 +41,9 @@ type WebhookParams struct {
|
||||||
|
|
||||||
// WebhookEdit stores data for editing of a webhook message.
|
// WebhookEdit stores data for editing of a webhook message.
|
||||||
type WebhookEdit struct {
|
type WebhookEdit struct {
|
||||||
Content string `json:"content,omitempty"`
|
Content *string `json:"content,omitempty"`
|
||||||
Components []MessageComponent `json:"components"`
|
Components *[]MessageComponent `json:"components,omitempty"`
|
||||||
Embeds []*MessageEmbed `json:"embeds,omitempty"`
|
Embeds *[]*MessageEmbed `json:"embeds,omitempty"`
|
||||||
Files []*File `json:"-"`
|
Files []*File `json:"-"`
|
||||||
AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"`
|
AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue