1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-07 12:38:05 +00:00

API: Add CrosspostMessage method

This commit is contained in:
Starshine System 2021-04-07 00:12:32 +02:00 committed by diamondburned
parent 9925461a25
commit 37d285184a

View file

@ -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.