Skip to content

Commit

Permalink
API: Add CrosspostMessage method
Browse files Browse the repository at this point in the history
  • Loading branch information
starshine-sys authored and diamondburned committed Apr 6, 2021
1 parent 9925461 commit 37d2851
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions api/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,19 @@ func (c *Client) EditMessageComplex(
)
}

// CrosspostMessage crossposts a message in a news channel to following channels.
// This endpoint requires the SEND_MESSAGES permission if the current user sent the message,
// or additionally the MANAGE_MESSAGES permission for all other messages.
func (c *Client) CrosspostMessage(channelID discord.ChannelID, messageID discord.MessageID) (*discord.Message, error) {
var msg *discord.Message

return msg, c.RequestJSON(
&msg,
"POST",
EndpointChannels+channelID.String()+"/messages/"+messageID.String()+"/crosspost",
)
}

// DeleteMessage delete a message. If operating on a guild channel and trying
// to delete a message that was not sent by the current user, this endpoint
// requires the MANAGE_MESSAGES permission.
Expand Down

0 comments on commit 37d2851

Please sign in to comment.