From 37d285184a3987c5703ac82a7d13b68254059dd1 Mon Sep 17 00:00:00 2001 From: Starshine System Date: Wed, 7 Apr 2021 00:12:32 +0200 Subject: [PATCH] API: Add CrosspostMessage method --- api/message.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/api/message.go b/api/message.go index 6f89d21..49c26cc 100644 --- a/api/message.go +++ b/api/message.go @@ -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.