Documentation ¶
Index ¶
- Constants
- func AddGuildMember(client httd.Puter, guildID, userID Snowflake, params *AddGuildMemberParams) (ret *Member, err error)
- func AddGuildMemberRole(client httd.Puter, guildID, userID, roleID Snowflake) (err error)
- func AddPinnedChannelMessage(client httd.Puter, channelID, msgID Snowflake) (err error)
- func BeginGuildPrune(client httd.Poster, id Snowflake, params *GuildPruneParams) (ret *GuildPruneCount, err error)
- func BulkDeleteMessages(client httd.Poster, chanID Snowflake, params *BulkDeleteMessagesParams) (err error)
- func CreateChannelInvites(client httd.Poster, id Snowflake, params *CreateChannelInvitesParams) (ret *Invite, err error)
- func CreateChannelMessage(client httd.Poster, channelID Snowflake, params *CreateMessageParams) (ret *Message, err error)
- func CreateDM(client httd.Poster, recipientID Snowflake) (ret *Channel, err error)
- func CreateGroupDM(client httd.Poster, params *CreateGroupDMParams) (ret *Channel, err error)
- func CreateGuild(client httd.Poster, params *CreateGuildParams) (ret *Guild, err error)
- func CreateGuildBan(client httd.Puter, guildID, userID Snowflake, params *CreateGuildBanParams) (err error)
- func CreateGuildChannel(client httd.Poster, id Snowflake, params *CreateGuildChannelParams) (ret *Channel, err error)
- func CreateGuildEmoji(client httd.Poster, guildID Snowflake) (ret *Emoji, err error)
- func CreateGuildIntegration(client httd.Poster, guildID Snowflake, params *CreateGuildIntegrationParams) (err error)
- func CreateGuildRole(client httd.Poster, id Snowflake, params *CreateGuildRoleParams) (ret *Role, err error)
- func CreateReaction(client httd.Puter, channelID, messageID Snowflake, emoji interface{}) (ret *Reaction, err error)
- func CreateWebhook(client httd.Poster, channelID Snowflake, params *CreateWebhookParams) (ret *Webhook, err error)
- func DeleteAllReactions(client httd.Deleter, channelID, messageID Snowflake) (err error)
- func DeleteChannel(client httd.Deleter, id Snowflake) (err error)
- func DeleteChannelPermission(client httd.Deleter, channelID, overwriteID Snowflake) (err error)
- func DeleteGuild(client httd.Deleter, id Snowflake) (err error)
- func DeleteGuildEmoji(client httd.Deleter, guildID, emojiID Snowflake) (err error)
- func DeleteGuildIntegration(client httd.Deleter, guildID, integrationID Snowflake) (err error)
- func DeleteGuildRole(client httd.Deleter, guildID, roleID Snowflake) (err error)
- func DeleteInvite(client httd.Deleter, inviteCode string) (invite *Invite, err error)
- func DeleteMessage(client httd.Deleter, channelID, msgID Snowflake) (err error)
- func DeleteOwnReaction(client httd.Deleter, channelID, messageID Snowflake, emoji interface{}) (err error)
- func DeletePinnedChannelMessage(client httd.Deleter, channelID, msgID Snowflake) (err error)
- func DeleteUserReaction(client httd.Deleter, channelID, messageID, userID Snowflake, emoji interface{}) (err error)
- func DeleteWebhook(client httd.Deleter, webhookID Snowflake) (err error)
- func DeleteWebhookWithToken(client httd.Deleter, id Snowflake, token string) (err error)
- func EditChannelPermissions(client httd.Puter, chanID, overwriteID Snowflake, ...) (err error)
- func EditMessage(client httd.Patcher, chanID, msgID Snowflake, params *EditMessageParams) (ret *Message, err error)
- func ExecuteGitHubWebhook(client httd.Poster, params *ExecuteWebhookParams, wait bool) (err error)
- func ExecuteSlackWebhook(client httd.Poster, params *ExecuteWebhookParams, wait bool) (err error)
- func ExecuteWebhook(client httd.Poster, params *ExecuteWebhookParams, wait bool, URLSuffix string) (err error)
- func GetChannel(client httd.Getter, id Snowflake) (ret *Channel, err error)
- func GetChannelInvites(client httd.Getter, id Snowflake) (ret []*Invite, err error)
- func GetChannelMessage(client httd.Getter, channelID, messageID Snowflake) (ret *Message, err error)
- func GetChannelMessages(client httd.Getter, channelID Snowflake, params URLParameters) (ret []*Message, err error)
- func GetChannelWebhooks(client httd.Getter, channelID Snowflake) (ret []*Webhook, err error)
- func GetCurrentUser(client httd.Getter) (ret *User, err error)
- func GetCurrentUserGuilds(client httd.Getter, params *GetCurrentUserGuildsParams) (ret []*Guild, err error)
- func GetGuild(client httd.Getter, id Snowflake) (ret *Guild, err error)
- func GetGuildBan(client httd.Getter, guildID, userID Snowflake) (ret *Ban, err error)
- func GetGuildBans(client httd.Getter, id Snowflake) (ret []*Ban, err error)
- func GetGuildChannels(client httd.Getter, id Snowflake) (ret []*Channel, err error)
- func GetGuildEmbed(client httd.Getter, guildID Snowflake) (ret *GuildEmbed, err error)
- func GetGuildEmoji(client httd.Getter, guildID, emojiID Snowflake) (ret *Emoji, err error)
- func GetGuildIntegrations(client httd.Getter, id Snowflake) (ret []*Integration, err error)
- func GetGuildInvites(client httd.Getter, id Snowflake) (ret []*Invite, err error)
- func GetGuildMember(client httd.Getter, guildID, userID Snowflake) (ret *Member, err error)
- func GetGuildMembers(client httd.Getter, guildID, after Snowflake, limit int) (ret []*Member, err error)
- func GetGuildPruneCount(client httd.Getter, id Snowflake, params *GuildPruneParams) (ret *GuildPruneCount, err error)
- func GetGuildRoles(client httd.Getter, guildID Snowflake) (ret []*Role, err error)
- func GetGuildVanityURL(client httd.Getter, guildID Snowflake) (ret *PartialInvite, err error)
- func GetGuildVoiceRegions(client httd.Getter, id Snowflake) (ret []*VoiceRegion, err error)
- func GetGuildWebhooks(client httd.Getter, guildID Snowflake) (ret []*Webhook, err error)
- func GetInvite(client httd.Getter, inviteCode string, withCounts bool) (invite *Invite, err error)
- func GetPinnedMessages(client httd.Getter, channelID Snowflake) (ret []*Message, err error)
- func GetReaction(client httd.Getter, channelID, messageID Snowflake, emoji interface{}, ...) (ret []*User, err error)
- func GetUser(client httd.Getter, id Snowflake) (ret *User, err error)
- func GetUserConnections(client httd.Getter) (ret []*UserConnection, err error)
- func GetUserDMs(client httd.Getter) (ret []*Channel, err error)
- func GetWebhook(client httd.Getter, id Snowflake) (ret *Webhook, err error)
- func GetWebhookWithToken(client httd.Getter, id Snowflake, token string) (ret *Webhook, err error)
- func GroupDMAddRecipient(client httd.Puter, channelID, userID Snowflake, ...) (err error)
- func GroupDMRemoveRecipient(client httd.Deleter, channelID, userID Snowflake) (err error)
- func GuildAuditLogs(client httd.Getter, guildID Snowflake, params *AuditLogParams) (log *AuditLog, err error)
- func LeaveGuild(client httd.Deleter, id Snowflake) (err error)
- func ListGuildEmojis(client httd.Getter, id Snowflake) (ret []*Emoji, err error)
- func ListVoiceRegions(client httd.Getter) (ret []*VoiceRegion, err error)
- func ModifyChannel(client httd.Patcher, changes *ModifyChannelParams) (ret *Channel, err error)
- func ModifyCurrentUser(client httd.Getter, params *ModifyCurrentUserParams) (ret *User, err error)
- func ModifyCurrentUserNick(client httd.Patcher, id Snowflake, params *ModifyCurrentUserNickParams) (nick string, err error)
- func ModifyGuild(client httd.Patcher, id Snowflake, params *ModifyGuildParams) (ret *Guild, err error)
- func ModifyGuildChannelPositions(client httd.Patcher, id Snowflake, params *ModifyGuildChannelPositionsParams) (ret *Guild, err error)
- func ModifyGuildEmbed(client httd.Patcher, guildID Snowflake, params *GuildEmbed) (ret *GuildEmbed, err error)
- func ModifyGuildEmoji(client httd.Patcher, guildID, emojiID Snowflake) (ret *Emoji, err error)
- func ModifyGuildIntegration(client httd.Patcher, guildID, integrationID Snowflake, ...) (err error)
- func ModifyGuildMember(client httd.Patcher, guildID, userID Snowflake, ...) (err error)
- func ModifyGuildRole(client httd.Patcher, guildID, roleID Snowflake, params *ModifyGuildRoleParams) (ret []*Role, err error)
- func ModifyGuildRolePositions(client httd.Patcher, guildID Snowflake, params *ModifyGuildRolePositionsParams) (ret []*Role, err error)
- func ModifyWebhook(client httd.Patcher, newWebhook *Webhook) (ret *Webhook, err error)
- func ModifyWebhookWithToken(client httd.Patcher, newWebhook *Webhook) (ret *Webhook, err error)
- func RemoveGuildBan(client httd.Deleter, guildID, userID Snowflake) (err error)
- func RemoveGuildMember(client httd.Deleter, guildID, userID Snowflake) (err error)
- func RemoveGuildMemberRole(client httd.Deleter, guildID, userID, roleID Snowflake) (err error)
- func SyncGuildIntegration(client httd.Poster, guildID, integrationID Snowflake) (err error)
- func TriggerTypingIndicator(client httd.Poster, channelID Snowflake) (err error)
- type AddGuildMemberParams
- type AuditLogParams
- type BodyUserCreateDM
- type BulkDeleteMessagesParams
- type CreateChannelInvitesParams
- type CreateGroupDMParams
- type CreateGuildBanParams
- type CreateGuildChannelParams
- type CreateGuildIntegrationParams
- type CreateGuildParams
- type CreateGuildRoleParams
- type CreateMessageParams
- type CreateWebhookParams
- type EditChannelPermissionsParams
- type EditMessageParams
- type ExecuteWebhookParams
- type GetChannelMessagesParams
- type GetCurrentUserGuildsParams
- type GetReactionURLParams
- type GroupDMAddRecipientParams
- type GuildPruneParams
- type ModifyChannelParams
- type ModifyCurrentUserNickParams
- type ModifyCurrentUserParams
- type ModifyGuildChannelPositionsParams
- type ModifyGuildIntegrationParams
- type ModifyGuildMemberParams
- type ModifyGuildParams
- type ModifyGuildRoleParams
- type ModifyGuildRolePositionsParams
- type URLParameters
Constants ¶
const (
EndpointChannels = "/channels"
)
Variables ¶
This section is empty.
Functions ¶
func AddGuildMember ¶
func AddGuildMember(client httd.Puter, guildID, userID Snowflake, params *AddGuildMemberParams) (ret *Member, err error)
AddGuildMember [PUT] Adds a user to the guild, provided you have a valid oauth2 access token for the user
with the guilds.join scope. Returns a 201 Created with the guild member as the body, or 204 No Content if the user is already a member of the guild. Fires a Guild Member Add Gateway event. Requires the bot to have the CREATE_INSTANT_INVITE permission.
Endpoint /guilds/{guild.id}/members/{user.id} Rate limiter /guilds/{guild.id}/members Discord documentation https://discordapp.com/developers/docs/resources/guild#add-guild-member Reviewed 2018-08-18 Comment All parameters to this endpoint except for access_token are optional.
func AddGuildMemberRole ¶
AddGuildMemberRole [PUT] Adds a role to a guild member. Requires the 'MANAGE_ROLES' permission. Returns a 204
empty response on success. Fires a Guild Member Update Gateway event.
Endpoint /guilds/{guild.id}/members/{user.id}/roles/{role.id} Rate limiter /guilds/{guild.id}/members TODO: I don't know if this is correct Discord documentation https://discordapp.com/developers/docs/resources/guild#add-guild-member-role Reviewed 2018-08-18 Comment -
func AddPinnedChannelMessage ¶
AddPinnedChannelMessage [GET] Pin a message in a channel. Requires the 'MANAGE_MESSAGES' permission.
Returns a 204 empty response on success.
Endpoint /channels/{channel.id}/pins/{message.id} Rate limiter [MAJOR] /channels/{channel.id}/pins Discord documentation https://discordapp.com/developers/docs/resources/channel#add-pinned-channel-message Reviewed 2018-06-10 Comment -
func BeginGuildPrune ¶
func BeginGuildPrune(client httd.Poster, id Snowflake, params *GuildPruneParams) (ret *GuildPruneCount, err error)
BeginGuildPrune [POST] Begin a prune operation. Requires the 'KICK_MEMBERS' permission. Returns an object
with one 'pruned' key indicating the number of members that were removed in the prune operation. Fires multiple Guild Member Remove Gateway events.
Endpoint /guilds/{guild.id}/prune Rate limiter /guilds/{guild.id}/prune Discord documentation https://discordapp.com/developers/docs/resources/guild#begin-guild-prune Reviewed 2018-08-18 Comment -
func BulkDeleteMessages ¶
func BulkDeleteMessages(client httd.Poster, chanID Snowflake, params *BulkDeleteMessagesParams) (err error)
BulkDeleteMessages [POST] Delete multiple messages in a single request. This endpoint can only be used
on guild channels and requires the 'MANAGE_MESSAGES' permission. Returns a 204 empty response on success. Fires multiple Message Delete Gateway events.Any message IDs given that do not exist or are invalid will count towards the minimum and maximum message count (currently 2 and 100 respectively). Additionally, duplicated IDs will only be counted once.
Endpoint /channels/{channel.id}/messages/bulk-delete Rate limiter [MAJOR] /channels/{channel.id}/messages [DELETE] TODO: is this limiter key incorrect? Discord documentation https://discordapp.com/developers/docs/resources/channel#delete-message Reviewed 2018-06-10 Comment This endpoint will not delete messages older than 2 weeks, and will fail if
any message provided is older than that.
func CreateChannelInvites ¶
func CreateChannelInvites(client httd.Poster, id Snowflake, params *CreateChannelInvitesParams) (ret *Invite, err error)
CreateChannelInvites [POST] Create a new invite object for the channel. Only usable for guild channels.
Requires the CREATE_INSTANT_INVITE permission. All JSON parameters for this route are optional, however the request body is not. If you are not sending any fields, you still have to send an empty JSON object ({}). Returns an invite object.
Endpoint /channels/{channel.id}/invites Rate limiter [MAJOR] /channels/{channel.id}/invites Discord documentation https://discordapp.com/developers/docs/resources/channel#create-channel-invite Reviewed 2018-06-07 Comment -
func CreateChannelMessage ¶
func CreateChannelMessage(client httd.Poster, channelID Snowflake, params *CreateMessageParams) (ret *Message, err error)
CreateChannelMessage [POST] Post a 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. If the tts field is set to true, the SEND_TTS_MESSAGES permission is required for the message to be spoken. Returns a message object. Fires a Message Create Gateway event. See message formatting for more information on how to properly format messages. The maximum request size when sending a message is 8MB.
Endpoint /channels/{channel.id}/messages Rate limiter [MAJOR] /channels/{channel.id}/messages Discord documentation https://discordapp.com/developers/docs/resources/channel#create-message Reviewed 2018-06-10 Comment Before using this endpoint, you must connect to and identify with a gateway
at least once. This endpoint supports both JSON and form data bodies. It does require multipart/form-data requests instead of the normal JSON request type when uploading files. Make sure you set your Content-Type to multipart/form-data if you're doing that. Note that in that case, the embed field cannot be used, but you can pass an url-encoded JSON body as a form value for payload_json.
func CreateDM ¶
GetUserDMs [POST] Create a new DM channel with a user. Returns a DM channel object. Endpoint /users/@me/channels Rate limiter /users TODO: is this correct? Discord documentation https://discordapp.com/developers/docs/resources/user#create-dm Reviewed 2018-06-10 Comment -
func CreateGroupDM ¶
func CreateGroupDM(client httd.Poster, params *CreateGroupDMParams) (ret *Channel, err error)
CreateGroupDM [POST] Create a new group DM channel with multiple users. Returns a DM channel object. Endpoint /users/@me/channels Rate limiter /users TODO: is this correct? Discord documentation https://discordapp.com/developers/docs/resources/user#create-group-dm Reviewed 2018-06-10 Comment -
func CreateGuild ¶
func CreateGuild(client httd.Poster, params *CreateGuildParams) (ret *Guild, err error)
CreateGuild [POST] Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event. Endpoint /guilds Rate limiter /guilds Discord documentation https://discordapp.com/developers/docs/resources/guild#create-guild Reviewed 2018-08-16 Comment This endpoint can be used only by bots in less than 10 guilds. Creating channel
categories from this endpoint is not supported.
func CreateGuildBan ¶
func CreateGuildBan(client httd.Puter, guildID, userID Snowflake, params *CreateGuildBanParams) (err error)
CreateGuildBan [PUT] Create a guild ban, and optionally delete previous messages sent by the banned user.
Requires the 'BAN_MEMBERS' permission. Returns a 204 empty response on success. Fires a Guild Ban Add Gateway event.
Endpoint /guilds/{guild.id}/bans/{user.id} Rate limiter /guilds/{guild.id}/bans Discord documentation https://discordapp.com/developers/docs/resources/guild#create-guild-ban Reviewed 2018-08-18 Comment -
func CreateGuildChannel ¶
func CreateGuildChannel(client httd.Poster, id Snowflake, params *CreateGuildChannelParams) (ret *Channel, err error)
CreateGuildChannel [POST] Create a new channel object for the guild. Requires the 'MANAGE_CHANNELS' permission.
Returns the new channel object on success. Fires a Channel Create Gateway event.
Endpoint /guilds/{guild.id}/channels Rate limiter /guilds/{guild.id}/channels Discord documentation https://discordapp.com/developers/docs/resources/guild#create-guild-channel Reviewed 2018-08-17 Comment All parameters for this endpoint are optional excluding 'name'
func CreateGuildEmoji ¶
CreateGuildEmoji [POST] Create a new emoji for the guild. Requires the
'MANAGE_EMOJIS' permission. Returns the new emoji object on success. Fires a Guild Emojis Update Gateway event.
Endpoint /guilds/{guild.id}/emojis Rate limiter [MAJOR] /guilds/{guild.id} // TODO: no idea if this is correct Discord documentation https://discordapp.com/developers/docs/resources/emoji#create-guild-emoji Reviewed 2018-06-10 Comment Emojis and animated emojis have a maximum file size of 256kb.
Attempting to upload an emoji larger than this limit will fail and return 400 Bad Request and an error message, but not a JSON status code.
func CreateGuildIntegration ¶
func CreateGuildIntegration(client httd.Poster, guildID Snowflake, params *CreateGuildIntegrationParams) (err error)
CreateGuildIntegration [POST] Attach an integration object from the current user to the guild. Requires
the 'MANAGE_GUILD' permission. Returns a 204 empty response on success. Fires a Guild Integrations Update Gateway event.
Endpoint /guilds/{guild.id}/integrations Rate limiter /guilds/{guild.id}/integrations Discord documentation https://discordapp.com/developers/docs/resources/guild#create-guild-integration Reviewed 2018-08-18 Comment -
func CreateGuildRole ¶
func CreateGuildRole(client httd.Poster, id Snowflake, params *CreateGuildRoleParams) (ret *Role, err error)
CreateGuildRole [POST] Create a new role for the guild. Requires the 'MANAGE_ROLES' permission.
Returns the new role object on success. Fires a Guild Role Create Gateway event.
Endpoint /guilds/{guild.id}/roles Rate limiter /guilds/{guild.id}/roles Discord documentation https://discordapp.com/developers/docs/resources/guild#create-guild-role Reviewed 2018-08-18 Comment All JSON params are optional.
func CreateReaction ¶
func CreateReaction(client httd.Puter, channelID, messageID Snowflake, emoji interface{}) (ret *Reaction, err error)
CreateReaction [PUT] Create a reaction for the message. This endpoint requires the 'READ_MESSAGE_HISTORY'
permission to be present on the current user. Additionally, if nobody else has reacted to the message using this emoji, this endpoint requires the 'ADD_REACTIONS' permission to be present on the current user. Returns a 204 empty response on success. The maximum request size when sending a message is 8MB.
Endpoint /channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me Rate limiter [MAJOR] /channels/{channel.id}/messages TODO: I have no idea what the key is Discord documentation https://discordapp.com/developers/docs/resources/channel#create-reaction Reviewed 2018-06-07 Comment - emoji either unicode (string) or *Emoji with an snowflake Snowflake if it's custom
func CreateWebhook ¶
func CreateWebhook(client httd.Poster, channelID Snowflake, params *CreateWebhookParams) (ret *Webhook, err error)
CreateWebhook [POST] Create a new webhook. Requires the 'MANAGE_WEBHOOKS' permission.
Returns a webhook object on success.
Endpoint /channels/{channel.id}/webhooks Rate limiter /channels/{channel.id}/webhooks Discord documentation https://discordapp.com/developers/docs/resources/webhook#create-webhook Reviewed 2018-08-14 Comment -
func DeleteAllReactions ¶
ReqCreateReaction [DELETE] Deletes all reactions on a message. This endpoint requires the 'MANAGE_MESSAGES'
permission to be present on the current user.
Endpoint /channels/{channel.id}/messages/{message.id}/reactions Rate limiter [MAJOR] /channels/{channel.id}/messages [DELETE] TODO: I have no idea if this is the correct key Discord documentation https://discordapp.com/developers/docs/resources/channel#delete-all-reactions Reviewed 2018-06-07 Comment - emoji either unicode (string) or *Emoji with an snowflake Snowflake if it's custom
func DeleteChannel ¶
DeleteChannel [DELETE] Delete a channel, or close a private message. Requires the 'MANAGE_CHANNELS'
permission for the guild. Deleting a category does not delete its child channels; they will have their parent_id removed and a Channel Update Gateway event will fire for each of them. Returns a channel object on success. Fires a Channel Delete Gateway event.
Endpoint /channels/{channel.id} Rate limiter [MAJOR] /channels/{channel.id} Discord documentation https://discordapp.com/developers/docs/resources/channel#deleteclose-channel Reviewed 2018-06-07 Comment Deleting a guild channel cannot be undone. Use this with caution, as it
is impossible to undo this action when performed on a guild channel. In contrast, when used with a private message, it is possible to undo the action by opening a private message with the recipient again.
func DeleteChannelPermission ¶
DeleteChannelPermission [DELETE] Delete a channel permission overwrite for a user or role in a channel.
Only usable for guild channels. Requires the 'MANAGE_ROLES' permission. Returns a 204 empty response on success. For more information about permissions, see permissions: https://discordapp.com/developers/docs/topics/permissions#permissions
Endpoint /channels/{channel.id}/permissions/{overwrite.id} Rate limiter [MAJOR] /channels/{channel.id}/permissions Discord documentation https://discordapp.com/developers/docs/resources/channel#delete-channel-permission Reviewed 2018-06-07 Comment -
func DeleteGuild ¶
DeleteGuild [DELETE] Delete a guild permanently. User must be owner. Returns 204 No Content on success.
Fires a Guild Delete Gateway event.
Endpoint /guilds/{guild.id} Rate limiter /guilds/{guild.id} Discord documentation https://discordapp.com/developers/docs/resources/guild#delete-guild Reviewed 2018-08-17 Comment -
func DeleteGuildEmoji ¶
DeleteGuildEmoji [DELETE] Delete the given emoji. Requires the
'MANAGE_EMOJIS' permission. Returns 204 No Content on success. Fires a Guild Emojis Update Gateway event.
Endpoint /guilds/{guild.id}/emojis/{emoji.id} Rate limiter [MAJOR] /guilds/{guild.id} // TODO: no idea if this is correct Discord documentation https://discordapp.com/developers/docs/resources/emoji#delete-guild-emoji Reviewed 2018-06-10 Comment -
func DeleteGuildIntegration ¶
DeleteGuildIntegration [DELETE] Delete the attached integration object for the guild.
Requires the 'MANAGE_GUILD' permission. Returns a 204 empty response on success. Fires a Guild Integrations Update Gateway event.
Endpoint /guilds/{guild.id}/integrations/{integration.id} Rate limiter /guilds/{guild.id}/integrations Discord documentation https://discordapp.com/developers/docs/resources/guild#delete-guild-integration Reviewed 2018-08-18 Comment -
func DeleteGuildRole ¶
DeleteGuildRole [DELETE] Delete a guild role. Requires the 'MANAGE_ROLES' permission. Returns a 204 empty
response on success. Fires a Guild Role Delete Gateway event.
Endpoint /guilds/{guild.id}/roles/{role.id} Rate limiter /guilds/{guild.id}/roles Discord documentation https://discordapp.com/developers/docs/resources/guild#delete-guild-role Reviewed 2018-08-18 Comment -
func DeleteInvite ¶
DeleteInvite [DELETE] Delete an invite. Requires the MANAGE_CHANNELS permission. Returns an invite
object on success.
Endpoint /invites/{invite.code} Rate limiter /invites Discord documentation https://discordapp.com/developers/docs/resources/invite#delete-invite Reviewed 2018-06-10 Comment -
func DeleteMessage ¶
DeleteMessage [DELETE] 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. Returns a 204 empty response on success. Fires a Message Delete Gateway event.
Endpoint /channels/{channel.id}/messages/{message.id} Rate limiter [MAJOR] /channels/{channel.id}/messages [DELETE] Discord documentation https://discordapp.com/developers/docs/resources/channel#delete-message Reviewed 2018-06-10 Comment -
func DeleteOwnReaction ¶
func DeleteOwnReaction(client httd.Deleter, channelID, messageID Snowflake, emoji interface{}) (err error)
DeleteOwnReaction [DELETE] Delete a reaction the current user has made for the message. Returns a 204
empty response on success.
Endpoint /channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me Rate limiter [MAJOR] /channels/{channel.id}/messages [DELETE] TODO: I have no idea what the key is Discord documentation https://discordapp.com/developers/docs/resources/channel#delete-own-reaction Reviewed 2018-06-07 Comment emoji either unicode (string) or *Emoji with an snowflake Snowflake if it's custom
func DeletePinnedChannelMessage ¶
DeletePinnedChannelMessage [DELETE] Delete a pinned message in a channel. Requires the 'MANAGE_MESSAGES'
permission. Returns a 204 empty response on success. Returns a 204 empty response on success.
Endpoint /channels/{channel.id}/pins/{message.id} Rate limiter [MAJOR] /channels/{channel.id}/pins Discord documentation https://discordapp.com/developers/docs/resources/channel#delete-pinned-channel-message Reviewed 2018-06-10 Comment -
func DeleteUserReaction ¶
func DeleteUserReaction(client httd.Deleter, channelID, messageID, userID Snowflake, emoji interface{}) (err error)
CreateReaction [DELETE] Deletes another user's reaction. This endpoint requires the 'MANAGE_MESSAGES'
permission to be present on the current user. Returns a 204 empty response on success.
Endpoint /channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me Rate limiter [MAJOR] /channels/{channel.id}/messages [DELETE] TODO: I have no idea if this is the correct key Discord documentation https://discordapp.com/developers/docs/resources/channel#delete-user-reaction Reviewed 2018-06-07 Comment emoji either unicode (string) or *Emoji with an snowflake Snowflake if it's custom
func DeleteWebhook ¶
DeleteWebhook [DELETE] Delete a webhook permanently. User must be owner. Returns a 204 NO CONTENT response
on success.
Endpoint /webhooks/{webhook.id} Rate limiter /webhooks/{webhook.id} Discord documentation https://discordapp.com/developers/docs/resources/webhook#delete-webhook Reviewed 2018-08-14 Comment -
func DeleteWebhookWithToken ¶
DeleteWebhookWithToken [DELETE] Same as DeleteWebhook, except this call does not require authentication. Endpoint /webhooks/{webhook.id}/{webhook.token} Rate limiter /webhooks/{webhook.id} Discord documentation https://discordapp.com/developers/docs/resources/webhook#delete-webhook-with-token Reviewed 2018-08-14 Comment -
func EditChannelPermissions ¶
func EditChannelPermissions(client httd.Puter, chanID, overwriteID Snowflake, params *EditChannelPermissionsParams) (err error)
EditChannelPermissions [PUT] Edit the channel permission overwrites for a user or role in a channel.
Only usable for guild channels. Requires the 'MANAGE_ROLES' permission. Returns a 204 empty response on success. For more information about permissions, see permissions.
Endpoint /channels/{channel.id}/permissions/{overwrite.id} Rate limiter [MAJOR] /channels/{channel.id}/permissions Discord documentation https://discordapp.com/developers/docs/resources/channel#edit-channel-permissions Reviewed 2018-06-07 Comment -
func EditMessage ¶
func EditMessage(client httd.Patcher, chanID, msgID Snowflake, params *EditMessageParams) (ret *Message, err error)
EditMessage [PATCH] Edit a previously sent message. You can only edit messages that have been sent by
the current user. Returns a message object. Fires a Message Update Gateway event.
Endpoint /channels/{channel.id}/messages/{message.id} Rate limiter [MAJOR] /channels/{channel.id}/messages Discord documentation https://discordapp.com/developers/docs/resources/channel#edit-message Reviewed 2018-06-10 Comment All parameters to this endpoint are optional.
func ExecuteGitHubWebhook ¶
func ExecuteGitHubWebhook(client httd.Poster, params *ExecuteWebhookParams, wait bool) (err error)
ExecuteGitHubWebhook [POST] Trigger a webhook in Discord from the GitHub app. Endpoint /webhooks/{webhook.id}/{webhook.token} Rate limiter /webhooks Discord documentation https://discordapp.com/developers/docs/resources/webhook#execute-githubcompatible-webhook Reviewed 2018-08-14 Comment Add a new webhook to your GitHub repo (in the repo's settings), and use this endpoint
as the "Payload URL." You can choose what events your Discord channel receives by choosing the "Let me select individual events" option and selecting individual events for the new webhook you're configuring.
func ExecuteSlackWebhook ¶
func ExecuteSlackWebhook(client httd.Poster, params *ExecuteWebhookParams, wait bool) (err error)
ExecuteSlackWebhook [POST] Trigger a webhook in Discord from the Slack app. Endpoint /webhooks/{webhook.id}/{webhook.token} Rate limiter /webhooks Discord documentation https://discordapp.com/developers/docs/resources/webhook#execute-slackcompatible-webhook Reviewed 2018-08-14 Comment Refer to Slack's documentation for more information. We do not support Slack's channel,
icon_emoji, mrkdwn, or mrkdwn_in properties.
func ExecuteWebhook ¶
func ExecuteWebhook(client httd.Poster, params *ExecuteWebhookParams, wait bool, URLSuffix string) (err error)
ExecuteWebhook [POST] Trigger a webhook in Discord. Endpoint /webhooks/{webhook.id}/{webhook.token} Rate limiter /webhooks/{webhook.id} Discord documentation https://discordapp.com/developers/docs/resources/webhook#execute-webhook Reviewed 2018-08-14 Comment This endpoint supports both JSON and form data bodies. It does require
multipart/form-data requests instead of the normal JSON request type when uploading files. Make sure you set your Content-Type to multipart/form-data if you're doing that. Note that in that case, the embeds field cannot be used, but you can pass an url-encoded JSON body as a form value for payload_json.
Comment#2 For the webhook embed objects, you can set every field except type (it will be
rich regardless of if you try to set it), provider, video, and any height, width, or proxy_url values for images.
TODO
func GetChannel ¶
GetChannel [GET] Get a channel by Snowflake. Returns a channel object. Endpoint /channels/{channel.id} Rate limiter [MAJOR] /channels/{channel.id} Discord documentation https://discordapp.com/developers/docs/resources/channel#get-channel Reviewed 2018-06-07 Comment -
func GetChannelInvites ¶
GetChannelInvites [GET] Returns a list of invite objects (with invite metadata) for the channel.
Only usable for guild channels. Requires the 'MANAGE_CHANNELS' permission.
Endpoint /channels/{channel.id}/invites Rate limiter [MAJOR] /channels/{channel.id}/invites Discord documentation https://discordapp.com/developers/docs/resources/channel#get-channel-invites Reviewed 2018-06-07 Comment -
func GetChannelMessage ¶
func GetChannelMessage(client httd.Getter, channelID, messageID Snowflake) (ret *Message, err error)
GetChannelMessage [GET] Returns a specific message in the channel. If operating on a guild channel,
this endpoints requires the 'READ_MESSAGE_HISTORY' permission to be present on the current user. Returns a message object on success.
Endpoint /channels/{channel.id}/messages/{message.id} Rate limiter [MAJOR] /channels/{channel.id}/messages Discord documentation https://discordapp.com/developers/docs/resources/channel#get-channel-message Reviewed 2018-06-10 Comment -
func GetChannelMessages ¶
func GetChannelMessages(client httd.Getter, channelID Snowflake, params URLParameters) (ret []*Message, err error)
GetChannelMessages [GET] Returns the messages for a channel. If operating on a guild channel, this
endpoint requires the 'VIEW_CHANNEL' permission to be present on the current user. If the current user is missing the 'READ_MESSAGE_HISTORY' permission in the channel then this will return no messages (since they cannot read the message history). Returns an array of message objects on success.
Endpoint /channels/{channel.id}/messages Rate limiter [MAJOR] /channels/{channel.id}/messages Discord documentation https://discordapp.com/developers/docs/resources/channel#get-channel-messages Reviewed 2018-06-10 Comment The before, after, and around keys are mutually exclusive, only one may
be passed at a time. see ReqGetChannelMessagesParams.
func GetChannelWebhooks ¶
GetChannelWebhooks [GET] Returns a list of channel webhook objects. Requires the 'MANAGE_WEBHOOKS' permission. Endpoint /channels/{channel.id}/webhooks Rate limiter /channels/{channel.id}/webhooks Discord documentation https://discordapp.com/developers/docs/resources/webhook#get-channel-webhooks Reviewed 2018-08-14 Comment -
func GetCurrentUser ¶
GetUser [GET] Returns the user object of the requester's account. For OAuth2, this requires
the identify scope, which will return the object without an email, and optionally the email scope, which returns the object with an email.
Endpoint /users/@me Rate limiter /users Discord documentation https://discordapp.com/developers/docs/resources/user#get-current-user Reviewed 2018-06-10 Comment -
func GetCurrentUserGuilds ¶
func GetCurrentUserGuilds(client httd.Getter, params *GetCurrentUserGuildsParams) (ret []*Guild, err error)
GetCurrentUserGuilds [GET] Returns a list of partial guild objects the current user is a member of.
Requires the guilds OAuth2 scope.
Endpoint /users/@me/guilds Rate limiter /users TODO: is this correct? Discord documentation https://discordapp.com/developers/docs/resources/user#get-current-user-guilds Reviewed 2018-06-10 Comment This endpoint returns 100 guilds by default, which is the maximum number of
guilds a non-bot user can join. Therefore, pagination is not needed for integrations that need to get a list of users' guilds.
func GetGuild ¶
GetGuild [GET] Returns the guild object for the given id. Endpoint /guilds/{guild.id} Rate limiter /guilds/{guild.id} Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild Reviewed 2018-08-17 Comment -
func GetGuildBan ¶
GetGuildBan [GET] Returns a ban object for the given user or a 404 not found if the ban cannot be found.
Requires the 'BAN_MEMBERS' permission.
Endpoint /guilds/{guild.id}/bans/{user.id} Rate limiter /guilds/{guild.id}/bans Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-ban Reviewed 2018-08-18 Comment -
func GetGuildBans ¶
GetGuildBans [GET] Returns a list of ban objects for the users banned from this guild.
Requires the 'BAN_MEMBERS' permission.
Endpoint /guilds/{guild.id}/bans Rate limiter /guilds/{guild.id}/bans Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-bans Reviewed 2018-08-18 Comment -
func GetGuildChannels ¶
GetGuildChannels [GET] Returns a list of guild channel objects. Endpoint /guilds/{guild.id}/channels Rate limiter /guilds/{guild.id}/channels Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-channels Reviewed 2018-08-17 Comment -
func GetGuildEmbed ¶
GetGuildEmbed [GET] Returns the guild embed object. Requires the 'MANAGE_GUILD' permission. Endpoint /guilds/{guild.id}/embed Rate limiter /guilds/{guild.id}/embed Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-embed Reviewed 2018-08-18 Comment -
func GetGuildEmoji ¶
GetGuildEmoji [GET] Returns an emoji object for the given guild and emoji IDs. Endpoint /guilds/{guild.id}/emojis/{emoji.id} Rate limiter [MAJOR] /guilds/{guild.id} // TODO: no idea if this is correct Discord documentation https://discordapp.com/developers/docs/resources/emoji#get-guild-emoji Reviewed 2018-06-10 Comment -
func GetGuildIntegrations ¶
GetGuildIntegrations [GET] Returns a list of integration objects for the guild.
Requires the 'MANAGE_GUILD' permission.
Endpoint /guilds/{guild.id}/integrations Rate limiter /guilds/{guild.id}/integrations Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-integrations Reviewed 2018-08-18 Comment -
func GetGuildInvites ¶
GetGuildInvites [GET] Returns a list of invite objects (with invite metadata) for the guild.
Requires the 'MANAGE_GUILD' permission.
Endpoint /guilds/{guild.id}/invites Rate limiter /guilds/{guild.id}/invites Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-invites Reviewed 2018-08-18 Comment -
func GetGuildMember ¶
GetGuildMember [GET] Returns a guild member object for the specified user. Endpoint /guilds/{guild.id}/members/{user.id} Rate limiter /guilds/{guild.id}/members Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-member Reviewed 2018-08-17 Comment -
func GetGuildMembers ¶
func GetGuildMembers(client httd.Getter, guildID, after Snowflake, limit int) (ret []*Member, err error)
GetGuildMembers [GET] Returns a list of guild member objects that are members of the guild. Endpoint /guilds/{guild.id}/members Rate limiter /guilds/{guild.id}/members Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-members Reviewed 2018-08-17 Comment All parameters to this endpoint are optional Comment#2 "List Guild Members" Comment#3 https://discordapp.com/developers/docs/resources/guild#list-guild-members-query-string-params
func GetGuildPruneCount ¶
func GetGuildPruneCount(client httd.Getter, id Snowflake, params *GuildPruneParams) (ret *GuildPruneCount, err error)
GetGuildPruneCount [GET] Returns an object with one 'pruned' key indicating the number of members that would
be removed in a prune operation. Requires the 'KICK_MEMBERS' permission.
Endpoint /guilds/{guild.id}/prune Rate limiter /guilds/{guild.id}/prune Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-prune-count Reviewed 2018-08-18 Comment -
func GetGuildRoles ¶
GetGuildRoles [GET] Returns a list of role objects for the guild. Endpoint /guilds/{guild.id}/roles Rate limiter /guilds/{guild.id}/roles Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-roles Reviewed 2018-08-18 Comment -
func GetGuildVanityURL ¶
GetGuildVanityURL [GET] Returns a partial invite object for guilds with that feature enabled.
Requires the 'MANAGE_GUILD' permission.
Endpoint /guilds/{guild.id}/vanity-url Rate limiter /guilds/{guild.id}/vanity-url Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-vanity-url Reviewed 2018-08-18 Comment -
func GetGuildVoiceRegions ¶
GetGuildVoiceRegions [GET] Returns a list of voice region objects for the guild. Unlike the similar /voice
route, this returns VIP servers when the guild is VIP-enabled.
Endpoint /guilds/{guild.id}/regions Rate limiter /guilds/{guild.id}/regions Discord documentation https://discordapp.com/developers/docs/resources/guild#get-guild-voice-regions Reviewed 2018-08-18 Comment -
func GetGuildWebhooks ¶
GetGuildWebhooks [GET] Returns a list of guild webhook objects. Requires the 'MANAGE_WEBHOOKS' permission. Endpoint /guilds/{guild.id}/webhooks Rate limiter /guilds/{guild.id}/webhooks Discord documentation https://discordapp.com/developers/docs/resources/webhook#get-guild-webhooks Reviewed 2018-08-14 Comment -
func GetInvite ¶
GetInvite [GET] Returns an invite object for the given code. Endpoint /invites/{invite.code} Rate limiter /invites Discord documentation https://discordapp.com/developers/docs/resources/invite#get-invite Reviewed 2018-06-10 Comment -
withCounts whether the invite should contain approximate member counts
func GetPinnedMessages ¶
GetPinnedMessages [GET] Returns all pinned messages in the channel as an array of message objects. Endpoint /channels/{channel.id}/pins Rate limiter [MAJOR] /channels/{channel.id}/pins Discord documentation https://discordapp.com/developers/docs/resources/channel#get-pinned-messages Reviewed 2018-06-10 Comment -
func GetReaction ¶
func GetReaction(client httd.Getter, channelID, messageID Snowflake, emoji interface{}, params URLParameters) (ret []*User, err error)
ReqGetReaction [GET] Get a list of users that reacted with this emoji. Returns an array of user objects on success. Endpoint /channels/{channel.id}/messages/{message.id}/reactions/{emoji} Rate limiter [MAJOR] /channels/{channel.id}/messages TODO: I have no idea if this is the correct key Discord documentation https://discordapp.com/developers/docs/resources/channel#get-reactions Reviewed 2018-06-07 Comment - emoji either unicode (string) or *Emoji with an snowflake Snowflake if it's custom
func GetUser ¶
GetUser [GET] Returns a user object for a given user Snowflake. Endpoint /users/{user.id} Rate limiter /users Discord documentation https://discordapp.com/developers/docs/resources/user#get-user Reviewed 2018-06-10 Comment -
func GetUserConnections ¶
CreateGroupDM [GET] Returns a list of connection objects. Requires the connections OAuth2 scope. Endpoint /users/@me/connections Rate limiter /users TODO: is this correct? Discord documentation https://discordapp.com/developers/docs/resources/user#get-user-connections Reviewed 2018-06-10 Comment -
func GetUserDMs ¶
GetUserDMs [GET] Returns a list of DM channel objects. Endpoint /users/@me/channels Rate limiter /users TODO: is this correct? Discord documentation https://discordapp.com/developers/docs/resources/user#get-user-dms Reviewed 2018-06-10 Comment -
func GetWebhook ¶
GetWebhook [GET] Returns the new webhook object for the given id. Endpoint /webhooks/{webhook.id} Rate limiter /webhooks/{webhook.id} Discord documentation https://discordapp.com/developers/docs/resources/webhook#get-webhook Reviewed 2018-08-14 Comment -
func GetWebhookWithToken ¶
GetWebhookWithToken [GET] Same as GetWebhook, except this call does not require authentication and returns
no user in the webhook object.
Endpoint /webhooks/{webhook.id}/{webhook.token} Rate limiter /webhooks/{webhook.id} Discord documentation https://discordapp.com/developers/docs/resources/webhook#get-webhook-with-token Reviewed 2018-08-14 Comment -
func GroupDMAddRecipient ¶
func GroupDMAddRecipient(client httd.Puter, channelID, userID Snowflake, params *GroupDMAddRecipientParams) (err error)
GroupDMAddRecipient [PUT] Adds a recipient to a Group DM using their access token.
Returns a 204 empty response on success.
Endpoint /channels/{channel.id}/recipients/{user.id} Rate limiter [MAJOR] /channels/{channel.id}/recipients Discord documentation https://discordapp.com/developers/docs/resources/channel#group-dm-add-recipient Reviewed 2018-06-10 Comment -
func GroupDMRemoveRecipient ¶
GroupDMRemoveRecipient [DELETE] Removes a recipient from a Group DM. Returns a 204 empty response on success. Endpoint /channels/{channel.id}/recipients/{user.id} Rate limiter [MAJOR] /channels/{channel.id}/recipients Discord documentation https://discordapp.com/developers/docs/resources/channel#group-dm-remove-recipient Reviewed 2018-06-10 Comment -
func GuildAuditLogs ¶
func GuildAuditLogs(client httd.Getter, guildID Snowflake, params *AuditLogParams) (log *AuditLog, err error)
GuildAuditLogs [GET] Returns an audit log object for the guild.
Requires the 'VIEW_AUDIT_LOG' permission.
Endpoint /guilds/{guild.id}/audit-logs Rate limiter [MAJOR] /guilds/{guild.id}/audit-logs Discord documentation https://discordapp.com/developers/docs/resources/audit-log#get-guild-audit-log Reviewed 2018-06-05 Comment -
func LeaveGuild ¶
LeaveGuild [DELETE] Leave a guild. Returns a 204 empty response on success. Endpoint /users/@me/guilds/{guild.id} Rate limiter /users TODO: is this correct? Discord documentation https://discordapp.com/developers/docs/resources/user#leave-guild Reviewed 2018-06-10 Comment -
func ListGuildEmojis ¶
ListGuildEmojis [GET] Returns a list of emoji objects for the given guild. Endpoint /guilds/{guild.id}/emojis Rate limiter [MAJOR] /guilds/{guild.id} // TODO: no idea if this is correct Discord documentation https://discordapp.com/developers/docs/resources/emoji#list-guild-emojis Reviewed 2018-06-10 Comment -
func ListVoiceRegions ¶
ListVoiceRegions [GET] Returns an array of voice region objects that can be used when creating servers. Endpoint /voice/regions Rate limiter /voice/regions Discord documentation https://discordapp.com/developers/docs/resources/voice#list-voice-regions Reviewed 2018-08-21 Comment -
func ModifyChannel ¶
func ModifyChannel(client httd.Patcher, changes *ModifyChannelParams) (ret *Channel, err error)
ModifyChannel PUT/PATCH Update a channels settings. Requires the 'MANAGE_CHANNELS' permission for the guild.
Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. Fires a Channel Update Gateway event. If modifying a category, individual Channel Update events will fire for each child channel that also changes. For the PATCH method, all the JSON Params are optional.
Endpoint /channels/{channel.id} Rate limiter [MAJOR] /channels/{channel.id} Discord documentation https://discordapp.com/developers/docs/resources/channel#modify-channel Reviewed 2018-06-07 Comment andersfylling: only implemented the patch method, as its parameters are optional.
func ModifyCurrentUser ¶
func ModifyCurrentUser(client httd.Getter, params *ModifyCurrentUserParams) (ret *User, err error)
ModifyCurrentUser [PATCH] Modify the requester's user account settings. Returns a user object on success. Endpoint /users/@me Rate limiter /users Discord documentation https://discordapp.com/developers/docs/resources/user#modify-current-user Reviewed 2018-06-10 Comment -
func ModifyCurrentUserNick ¶
func ModifyCurrentUserNick(client httd.Patcher, id Snowflake, params *ModifyCurrentUserNickParams) (nick string, err error)
ModifyCurrentUserNick [PATCH] Modifies the nickname of the current user in a guild. Returns a 200 with the
nickname on success. Fires a Guild Member Update Gateway event.
Endpoint /guilds/{guild.id}/members/@me/nick Rate limiter /guilds/{guild.id}/members TODO: I don't know if this is correct Discord documentation https://discordapp.com/developers/docs/resources/guild#modify-current-user-nick Reviewed 2018-08-18 Comment -
func ModifyGuild ¶
func ModifyGuild(client httd.Patcher, id Snowflake, params *ModifyGuildParams) (ret *Guild, err error)
ModifyGuild [PATCH] Modify a guild's settings. Requires the 'MANAGE_GUILD' permission. Returns the updated
guild object on success. Fires a Guild Update Gateway event.
Endpoint /guilds/{guild.id} Rate limiter /guilds/{guild.id} Discord documentation https://discordapp.com/developers/docs/resources/guild#modify-guild Reviewed 2018-08-17 Comment All parameters to this endpoint are optional
func ModifyGuildChannelPositions ¶
func ModifyGuildChannelPositions(client httd.Patcher, id Snowflake, params *ModifyGuildChannelPositionsParams) (ret *Guild, err error)
ModifyGuildChannelPositions [PATCH] Modify the positions of a set of channel objects for the guild. Requires
'MANAGE_CHANNELS' permission. Returns a 204 empty response on success. Fires multiple Channel Update Gateway events.
Endpoint /guilds/{guild.id}/channels Rate limiter /guilds/{guild.id}/channels Discord documentation https://discordapp.com/developers/docs/resources/guild#modify-guild-channel-positions Reviewed 2018-08-17 Comment Only channels to be modified are required, with the minimum being a swap
between at least two channels.
func ModifyGuildEmbed ¶
func ModifyGuildEmbed(client httd.Patcher, guildID Snowflake, params *GuildEmbed) (ret *GuildEmbed, err error)
ModifyGuildEmbed [PATCH] Modify a guild embed object for the guild. All attributes may be passed in
with JSON and modified. Requires the 'MANAGE_GUILD' permission. Returns the updated guild embed object.
Endpoint /guilds/{guild.id}/embed Rate limiter /guilds/{guild.id}/embed Discord documentation https://discordapp.com/developers/docs/resources/guild#modify-guild-embed Reviewed 2018-08-18 Comment -
func ModifyGuildEmoji ¶
ModifyGuildEmoji [PATCH] Modify the given emoji. Requires the 'MANAGE_EMOJIS'
permission. Returns the updated emoji object on success. Fires a Guild Emojis Update Gateway event.
Endpoint /guilds/{guild.id}/emojis/{emoji.id} Rate limiter [MAJOR] /guilds/{guild.id} // TODO: no idea if this is correct Discord documentation https://discordapp.com/developers/docs/resources/emoji#modify-guild-emoji Reviewed 2018-06-10 Comment -
func ModifyGuildIntegration ¶
func ModifyGuildIntegration(client httd.Patcher, guildID, integrationID Snowflake, params *ModifyGuildIntegrationParams) (err error)
ModifyGuildIntegration [POST] Modify the behavior and settings of a integration object for the guild.
Requires the 'MANAGE_GUILD' permission. Returns a 204 empty response on success. Fires a Guild Integrations Update Gateway event.
Endpoint /guilds/{guild.id}/integrations/{integration.id} Rate limiter /guilds/{guild.id}/integrations Discord documentation https://discordapp.com/developers/docs/resources/guild#modify-guild-integration Reviewed 2018-08-18 Comment -
func ModifyGuildMember ¶
func ModifyGuildMember(client httd.Patcher, guildID, userID Snowflake, params *ModifyGuildMemberParams) (err error)
ModifyGuildMember [PATCH] Modify attributes of a guild member. Returns a 204 empty response on success.
Fires a Guild Member Update Gateway event.
Endpoint /guilds/{guild.id}/members/{user.id} Rate limiter /guilds/{guild.id}/members Discord documentation https://discordapp.com/developers/docs/resources/guild#modify-guild-member Reviewed 2018-08-17 Comment All parameters to this endpoint are optional. When moving members to channels,
the API user must have permissions to both connect to the channel and have the MOVE_MEMBERS permission.
func ModifyGuildRole ¶
func ModifyGuildRole(client httd.Patcher, guildID, roleID Snowflake, params *ModifyGuildRoleParams) (ret []*Role, err error)
ModifyGuildRole [PATCH] Modify a guild role. Requires the 'MANAGE_ROLES' permission. Returns the updated
role on success. Fires a Guild Role Update Gateway event.
Endpoint /guilds/{guild.id}/roles/{role.id} Rate limiter /guilds/{guild.id}/roles Discord documentation https://discordapp.com/developers/docs/resources/guild#modify-guild-role Reviewed 2018-08-18 Comment -
func ModifyGuildRolePositions ¶
func ModifyGuildRolePositions(client httd.Patcher, guildID Snowflake, params *ModifyGuildRolePositionsParams) (ret []*Role, err error)
ModifyGuildRolePositions [PATCH] Modify the positions of a set of role objects for the guild. Requires the
'MANAGE_ROLES' permission. Returns a list of all of the guild's role objects on success. Fires multiple Guild Role Update Gateway events.
Endpoint /guilds/{guild.id}/roles Rate limiter /guilds/{guild.id}/roles Discord documentation https://discordapp.com/developers/docs/resources/guild#modify-guild-role-positions Reviewed 2018-08-18 Comment -
func ModifyWebhook ¶
ModifyWebhook [PATCH] Modify a webhook. Requires the 'MANAGE_WEBHOOKS' permission.
Returns the updated webhook object on success.
Endpoint /webhooks/{webhook.id} Rate limiter /webhooks/{webhook.id} Discord documentation https://discordapp.com/developers/docs/resources/webhook#modify-webhook Reviewed 2018-08-14 Comment All parameters to this endpoint are optional. Not tested:extra json fields might
cause an issue. Consider writing a json params object.
func ModifyWebhookWithToken ¶
ModifyWebhookWithToken [PATCH] Same as ModifyWebhook, except this call does not require authentication,
does not accept a channel_id parameter in the body, and does not return a user in the webhook object.
Endpoint /webhooks/{webhook.id}/{webhook.token} Rate limiter /webhooks/{webhook.id} Discord documentation https://discordapp.com/developers/docs/resources/webhook#modify-webhook-with-token Reviewed 2018-08-14 Comment All parameters to this endpoint are optional. Not tested:extra json fields might
cause an issue. Consider writing a json params object.
func RemoveGuildBan ¶
RemoveGuildBan [DELETE] Remove the ban for a user. Requires the 'BAN_MEMBERS' permissions.
Returns a 204 empty response on success. Fires a Guild Ban Remove Gateway event.
Endpoint /guilds/{guild.id}/bans/{user.id} Rate limiter /guilds/{guild.id}/bans Discord documentation https://discordapp.com/developers/docs/resources/guild#remove-guild-ban Reviewed 2018-08-18 Comment -
func RemoveGuildMember ¶
RemoveGuildMember [DELETE] Remove a member from a guild. Requires 'KICK_MEMBERS' permission. Returns a 204
empty response on success. Fires a Guild Member Remove Gateway event.
Endpoint /guilds/{guild.id}/members/{user.id} Rate limiter /guilds/{guild.id}/members Discord documentation https://discordapp.com/developers/docs/resources/guild#remove-guild-member Reviewed 2018-08-18 Comment -
func RemoveGuildMemberRole ¶
RemoveGuildMemberRole [DELETE] Removes a role from a guild member. Requires the 'MANAGE_ROLES' permission. Returns
a 204 empty response on success. Fires a Guild Member Update Gateway event.
Endpoint /guilds/{guild.id}/members/{user.id}/roles/{role.id} Rate limiter /guilds/{guild.id}/members Discord documentation https://discordapp.com/developers/docs/resources/guild#remove-guild-member-role Reviewed 2018-08-18 Comment -
func SyncGuildIntegration ¶
SyncGuildIntegration [POST] Sync an integration. Requires the 'MANAGE_GUILD' permission.
Returns a 204 empty response on success.
Endpoint /guilds/{guild.id}/integrations/{integration.id}/sync Rate limiter /guilds/{guild.id}/integrations TODO: is this correct? Discord documentation https://discordapp.com/developers/docs/resources/guild#sync-guild-integration Reviewed 2018-08-18 Comment -
func TriggerTypingIndicator ¶
TriggerTypingIndicator [POST] Post a typing indicator for the specified channel. Generally bots should
not implement this route. However, if a bot is responding to a command and expects the computation to take a few seconds, this endpoint may be called to let the user know that the bot is processing their message. Returns a 204 empty response on success. Fires a Typing Start Gateway event.
Endpoint /channels/{channel.id}/typing Rate limiter [MAJOR] /channels/{channel.id}/typing Discord documentation https://discordapp.com/developers/docs/resources/channel#trigger-typing-indicator Reviewed 2018-06-10 Comment -
Types ¶
type AddGuildMemberParams ¶
type AddGuildMemberParams struct { AccessToken string `json:"access_token"` Nick string `json:"nick,omitempty"` Roles []Snowflake `json:"roles"` Mute bool `json:"mute"` Deaf bool `json:"deaf"` }
AddGuildMemberParams https://discordapp.com/developers/docs/resources/guild#add-guild-member-json-params
type AuditLogParams ¶
type AuditLogParams struct { UserID Snowflake `urlparam:"user_id,omitempty"` // filter the log for a user id ActionType uint `urlparam:"action_type,omitempty"` // the type of audit log event Before Snowflake `urlparam:"before,omitempty"` // filter the log before a certain entry id Limit int `urlparam:"limit,omitempty"` // how many entries are returned (default 50, minimum 1, maximum 100) }
AuditLogParams set params used in endpoint request https://discordapp.com/developers/docs/resources/audit-log#get-guild-audit-log-query-string-parameters
type BodyUserCreateDM ¶
type BodyUserCreateDM struct {
RecipientID Snowflake `json:"recipient_id"`
}
type BulkDeleteMessagesParams ¶
type BulkDeleteMessagesParams struct { Messages []Snowflake `json:"messages"` // contains filtered or unexported fields }
BulkDeleteMessagesParams https://discordapp.com/developers/docs/resources/channel#bulk-delete-messages-json-params
func (*BulkDeleteMessagesParams) AddMessage ¶
func (p *BulkDeleteMessagesParams) AddMessage(msg *Message) (err error)
func (*BulkDeleteMessagesParams) Valid ¶
func (p *BulkDeleteMessagesParams) Valid() (err error)
type CreateChannelInvitesParams ¶
type CreateChannelInvitesParams struct { MaxAge int `json:"max_age,omitempty"` // duration of invite in seconds before expiry, or 0 for never. default 86400 (24 hours) MaxUses int `json:"max_uses,omitempty"` // max number of uses or 0 for unlimited. default 0 Temporary bool `json:"temporary,omitempty"` // whether this invite only grants temporary membership. default false Unique bool `json:"unique,omitempty"` // if true, don't try to reuse a similar invite (useful for creating many unique one time use invites). default false }
ReqCreateChannelInvitesParams https://discordapp.com/developers/docs/resources/channel#create-channel-invite-json-params
type CreateGroupDMParams ¶
type CreateGroupDMParams struct { AccessTokens []string `json:"access_tokens"` // access tokens of users that have granted your app the gdm.join scope Nicks map[Snowflake]string `json:"nicks"` // userID => nickname }
BodyUserCreateGroupDM https://discordapp.com/developers/docs/resources/user#create-group-dm
type CreateGuildBanParams ¶
type CreateGuildBanParams struct { DeleteMessageDays int `urlparam:"delete_message_days"` // number of days to delete messages for (0-7) Reason string `urlparam:"reason"` // reason for being banned }
CreateGuildBanParams https://discordapp.com/developers/docs/resources/guild#create-guild-ban-query-string-params
func (*CreateGuildBanParams) GetQueryString ¶
func (params *CreateGuildBanParams) GetQueryString() string
getQueryString this ins't really pretty, but it works.
type CreateGuildChannelParams ¶
type CreateGuildChannelParams struct { Name string `json:"name"` // | Type uint `json:"type,omitempty"` // ?| Topic string `json:"topic,omitempty"` // ?| Bitrate uint `json:"bitrate,omitempty"` // ?| UserLimit uint `json:"user_limit,omitempty"` // ?| PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites,omitempty"` // ?| ParentID Snowflake `json:"parent_id,omitempty"` // ?| NSFW bool `json:"nsfw,omitempty"` // ?| }
CreateGuildChannelParams https://discordapp.com/developers/docs/resources/guild#create-guild-channel-json-params
type CreateGuildIntegrationParams ¶
type CreateGuildIntegrationParams struct { Type string `json:"type"` ID Snowflake `json:"id"` }
CreateGuildIntegrationParams https://discordapp.com/developers/docs/resources/guild#create-guild-integration-json-params
type CreateGuildParams ¶
type CreateGuildParams struct { Name string `json:"name"` Region string `json:"region"` Icon string `json:"icon"` VerificationLvl int `json:"verification_level"` DefaultMsgNotifications DefaultMessageNotificationLvl `json:"default_message_notifications"` ExplicitContentFilter ExplicitContentFilterLvl `json:"explicit_content_filter"` Roles []*Role `json:"roles"` Channels []*PartialChannel `json:"channels"` }
CreateGuildParams https://discordapp.com/developers/docs/resources/guild#create-guild-json-params example partial channel object:
{ "name": "naming-things-is-hard", "type": 0 }
type CreateGuildRoleParams ¶
type CreateGuildRoleParams struct { Name string `json:"name,omitempty"` Permissions int `json:"permissions,omitempty"` Color int `json:"color,omitempty"` Hoist bool `json:"hoist,omitempty"` Mentionable bool `json:"mentionable,omitempty"` }
CreateGuildRoleParams https://discordapp.com/developers/docs/resources/guild#create-guild-role-json-params
type CreateMessageParams ¶
type CreateMessageParams struct { Content string `json:"content"` Nonce Snowflake `json:"nonce,omitempty"` Tts bool `json:"tts,omitempty"` File interface{} `json:"file,omitempty"` // TODO: what is this supposed to be? Embed *ChannelEmbed `json:"embed,omitempty"` // embedded rich content PayloadJSON string `json:"payload_json,omitempty"` }
func NewCreateMessageByString ¶
func NewCreateMessageByString(content string) *CreateMessageParams
type CreateWebhookParams ¶
type CreateWebhookParams struct { Name string `json:"name"` // name of the webhook (2-32 characters) Avatar string `json:"avatar"` // avatar data uri scheme, image for the default webhook avatar }
CreateWebhookParams json params for the create webhook rest request avatar string: https://discordapp.com/developers/docs/resources/user#avatar-data
type EditChannelPermissionsParams ¶
type EditChannelPermissionsParams struct { Allow int `json:"allow"` // the bitwise value of all allowed permissions Deny int `json:"deny"` // the bitwise value of all disallowed permissions Type string `json:"type"` // "member" for a user or "role" for a role }
EditChannelPermissionsParams https://discordapp.com/developers/docs/resources/channel#edit-channel-permissions-json-params
type EditMessageParams ¶
type EditMessageParams struct { Content string `json:"content,omitempty"` Embed *ChannelEmbed `json:"embed,omitempty"` // embedded rich content }
EditMessageParams https://discordapp.com/developers/docs/resources/channel#edit-message-json-params
type ExecuteWebhookParams ¶
type ExecuteWebhookParams struct { WebhookID Snowflake `json:"-"` Token string `json:"-"` Content string `json:"content"` Username string `json:"username"` AvatarURL string `json:"avatar_url"` TTS bool `json:"tts"` File interface{} `json:"file"` Embeds []*ChannelEmbed `json:"embeds"` }
func NewExecuteWebhookParams ¶
func NewExecuteWebhookParams(id Snowflake, token string) (ret *ExecuteWebhookParams, err error)
type GetChannelMessagesParams ¶
type GetChannelMessagesParams struct { Around Snowflake `urlparam:"around,omitempty"` Before Snowflake `urlparam:"before,omitempty"` After Snowflake `urlparam:"after,omitempty"` Limit int `urlparam:"limit,omitempty"` }
GetChannelMessagesParams https://discordapp.com/developers/docs/resources/channel#get-channel-messages-query-string-params TODO: ensure limits
func (*GetChannelMessagesParams) GetQueryString ¶
func (params *GetChannelMessagesParams) GetQueryString() string
getQueryString this ins't really pretty, but it works.
type GetCurrentUserGuildsParams ¶
type GetCurrentUserGuildsParams struct { Before Snowflake `urlparam:"before,omitempty"` After Snowflake `urlparam:"after,omitempty"` Limit int `urlparam:"limit,omitempty"` }
func (*GetCurrentUserGuildsParams) GetQueryString ¶
func (params *GetCurrentUserGuildsParams) GetQueryString() string
getQueryString this ins't really pretty, but it works.
type GetReactionURLParams ¶
type GetReactionURLParams struct { Before Snowflake `urlparam:"before,omitempty"` // get users before this user Snowflake After Snowflake `urlparam:"after,omitempty"` // get users after this user Snowflake Limit int `urlparam:"limit,omitempty"` // max number of users to return (1-100) }
ReqGetReactionParams https://discordapp.com/developers/docs/resources/channel#get-reactions-query-string-params
func (*GetReactionURLParams) GetQueryString ¶
func (params *GetReactionURLParams) GetQueryString() string
getQueryString this ins't really pretty, but it works.
type GuildPruneParams ¶
type GuildPruneParams struct {
Days int `urlparam:"days"` // number of days to count prune for (1 or more)
}
GetGuildPruneCountParams https://discordapp.com/developers/docs/resources/guild#get-guild-prune-count-query-string-params
func (*GuildPruneParams) GetQueryString ¶
func (params *GuildPruneParams) GetQueryString() string
getQueryString this ins't really pretty, but it works.
type ModifyChannelParams ¶
type ModifyChannelParams = Channel
ModifyChannelParams https://discordapp.com/developers/docs/resources/channel#modify-channel-json-params
type ModifyCurrentUserNickParams ¶
type ModifyCurrentUserNickParams struct {
Nick string `json:"nick"` // :CHANGE_NICKNAME
}
ModifyGuildMemberParams https://discordapp.com/developers/docs/resources/guild#modify-guild-member-json-params
type ModifyCurrentUserParams ¶
type ModifyGuildChannelPositionsParams ¶
type ModifyGuildChannelPositionsParams struct { ID Snowflake `json:"id"` Position int `json:"position"` }
ModifyGuildChannelPositionsParams https://discordapp.com/developers/docs/resources/guild#modify-guild-channel-positions-json-params
type ModifyGuildIntegrationParams ¶
type ModifyGuildIntegrationParams struct { ExpireBehavior int `json:"expire_behavior"` ExpireGracePeriod int `json:"expire_grace_period"` EnableEmoticons bool `json:"enable_emoticons"` }
ModifyGuildIntegrationParams https://discordapp.com/developers/docs/resources/guild#modify-guild-integration-json-params
type ModifyGuildMemberParams ¶
type ModifyGuildMemberParams struct { Nick string `json:"nick,omitempty"` // :MANAGE_NICKNAMES Roles []Snowflake `json:"roles,omitempty"` // :MANAGE_ROLES Mute bool `json:"mute,omitempty"` // :MUTE_MEMBERS Deaf bool `json:"deaf,omitempty"` // :DEAFEN_MEMBERS ChannelID Snowflake `json:"channel_id,omitempty"` // :MOVE_MEMBERS }
ModifyGuildMemberParams https://discordapp.com/developers/docs/resources/guild#modify-guild-member-json-params
type ModifyGuildParams ¶
type ModifyGuildParams struct { Name string `json:"name,omitempty"` Region string `json:"region,omitempty"` VerificationLvl int `json:"verification_level,omitempty"` DefaultMsgNotifications DefaultMessageNotificationLvl `json:"default_message_notifications,omitempty"` ExplicitContentFilter ExplicitContentFilterLvl `json:"explicit_content_filter,omitempty"` AFKChannelID Snowflake `json:"afk_channel_id,omitempty"` AFKTimeout int `json:"afk_timeout,omitempty"` Icon string `json:"icon,omitempty"` OwnerID Snowflake `json:"owner_id,omitempty"` Splash string `json:"splash,omitempty"` SystemChannelID Snowflake `json:"system_channel_id,omitempty"` }
ModifyGuildParams https://discordapp.com/developers/docs/resources/guild#modify-guild-json-params
type ModifyGuildRoleParams ¶
type ModifyGuildRolePositionsParams ¶
type ModifyGuildRolePositionsParams struct { ID Snowflake `json:"id"` Position int `json:"position"` }
ModifyGuildRolePositionsParams https://discordapp.com/developers/docs/resources/guild#modify-guild-role-positions-json-params
type URLParameters ¶
type URLParameters interface {
GetQueryString() string
}