1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-10-31 20:14:21 +00:00

API: implement #49

This commit is contained in:
mavolin 2020-05-12 05:21:48 +02:00
parent 323dc2193e
commit 72136d5aef
No known key found for this signature in database
GPG key ID: D8681218EDF216DF

View file

@ -106,6 +106,32 @@ func (c *Client) Message(channelID, messageID discord.Snowflake) (*discord.Messa
EndpointChannels+channelID.String()+"/messages/"+messageID.String())
}
// SendText posts a only-text message to a guild text or DM channel.
//
// If operating on a guild channel, this endpoint requires the SEND_MESSAGES
// permission to be present on the current user.
//
// Fires a Message Create Gateway event.
func (c *Client) SendText(channelID discord.Snowflake, content string) (*discord.Message, error) {
return c.SendMessageComplex(channelID, SendMessageData{
Content: content,
})
}
// SendEmbed posts an Embed to a guild text or DM channel.
//
// If operating on a guild channel, this endpoint requires the SEND_MESSAGES
// permission to be present on the current user.
//
// Fires a Message Create Gateway event.
func (c *Client) SendEmbed(
channelID discord.Snowflake, e discord.Embed) (*discord.Message, error) {
return c.SendMessageComplex(channelID, SendMessageData{
Embed: &e,
})
}
// SendMessage posts a message to a guild text or DM channel.
//
// If operating on a guild channel, this endpoint requires the SEND_MESSAGES