Documentation ¶
Index ¶
- Constants
- Variables
- func NewRequest() *request
- type AddGuildMemberParams
- type BaseStickerParams
- type BeginGuildPruneParams
- type Cache
- type CacheError
- type CacheValue
- type ChannelCreateParams
- type Client
- func (c *Client) AddGuildCommand(ctx context.Context, app, guild objects.SnowflakeObject, ...) (*objects.ApplicationCommand, error)
- func (c *Client) AddGuildMember(ctx context.Context, guild, user objects.SnowflakeObject, ...) (*objects.GuildMember, error)
- func (c *Client) AddGuildMemberRole(ctx context.Context, guild, user, role objects.SnowflakeObject, reason string) error
- func (c *Client) AddPinnedMessage(ctx context.Context, channel, message objects.SnowflakeObject) error
- func (c *Client) AddThreadMember(ctx context.Context, thread, user objects.SnowflakeObject) error
- func (c *Client) BatchEditApplicationCommandPermissions(ctx context.Context, app, guild objects.SnowflakeObject, ...) ([]*objects.GuildApplicationCommandPermissions, error)
- func (c *Client) BeginGuildPrune(ctx context.Context, guild objects.SnowflakeObject, ...) (int, error)
- func (c *Client) BulkDeleteMessages(ctx context.Context, channel objects.SnowflakeObject, ...) error
- func (c *Client) BulkOverwriteGlobalCommands(ctx context.Context, app objects.SnowflakeObject, ...) ([]*objects.ApplicationCommand, error)
- func (c *Client) BulkOverwriteGuildCommands(ctx context.Context, application, guild objects.SnowflakeObject, ...) ([]*objects.ApplicationCommand, error)
- func (c *Client) CreateBan(ctx context.Context, guild, user objects.SnowflakeObject, ...) error
- func (c *Client) CreateChannelInvite(ctx context.Context, channel objects.SnowflakeObject, ...) (*objects.Invite, error)
- func (c *Client) CreateCommand(ctx context.Context, app objects.SnowflakeObject, ...) (*objects.ApplicationCommand, error)
- func (c *Client) CreateDM(ctx context.Context, params *CreateDMParams) (*objects.Channel, error)
- func (c *Client) CreateFollowupMessage(ctx context.Context, applicationID objects.SnowflakeObject, token string, ...) (*objects.Message, error)
- func (c *Client) CreateGroupDM(ctx context.Context, params *CreateGroupDMParams) (*objects.Channel, error)
- func (c *Client) CreateGuild(ctx context.Context, params *CreateGuildParams) (*objects.Guild, error)
- func (c *Client) CreateGuildChannel(ctx context.Context, id objects.SnowflakeObject, params *ChannelCreateParams) (*objects.Channel, error)
- func (c *Client) CreateGuildFromTemplate(ctx context.Context, code string, reason string) (*objects.Guild, error)
- func (c *Client) CreateGuildRole(ctx context.Context, guild objects.SnowflakeObject, ...) (*objects.Role, error)
- func (c *Client) CreateGuildScheduledEvent(ctx context.Context, guildID objects.SnowflakeObject, ...) (*objects.GuildScheduledEvent, error)
- func (c *Client) CreateGuildSticker(ctx context.Context, guildID objects.SnowflakeObject, ...) (*objects.Sticker, error)
- func (c *Client) CreateGuildTemplate(ctx context.Context, guild objects.SnowflakeObject, ...) (*objects.Template, error)
- func (c *Client) CreateInteractionResponse(ctx context.Context, interactionID objects.SnowflakeObject, token string, ...) error
- func (c *Client) CreateMessage(ctx context.Context, channel objects.SnowflakeObject, ...) (*objects.Message, error)
- func (c *Client) CreateReaction(ctx context.Context, channel, message objects.SnowflakeObject, ...) error
- func (c *Client) CreateWebhook(ctx context.Context, channel objects.SnowflakeObject, ...) (*objects.Webhook, error)
- func (c *Client) CrossPostMessage(ctx context.Context, channel, message objects.SnowflakeObject) (*objects.Message, error)
- func (c *Client) DeleteAllReactions(ctx context.Context, channel, message objects.SnowflakeObject) error
- func (c *Client) DeleteChannel(ctx context.Context, id objects.SnowflakeObject, reason string) (*objects.Channel, error)
- func (c *Client) DeleteChannelPermission(ctx context.Context, channel, overwrite objects.SnowflakeObject, reason string) error
- func (c *Client) DeleteCommand(ctx context.Context, app, commandID objects.SnowflakeObject) error
- func (c *Client) DeleteEmojiReactions(ctx context.Context, channel, message objects.SnowflakeObject, ...) error
- func (c *Client) DeleteFollowupMessage(ctx context.Context, applicationID objects.SnowflakeObject, token string, ...) error
- func (c *Client) DeleteGuild(ctx context.Context, id objects.SnowflakeObject) error
- func (c *Client) DeleteGuildCommand(ctx context.Context, app, guild, commandID objects.SnowflakeObject) error
- func (c *Client) DeleteGuildIntegration(ctx context.Context, guild, integration objects.SnowflakeObject, reason string) error
- func (c *Client) DeleteGuildRole(ctx context.Context, guild, role objects.SnowflakeObject, reason string) error
- func (c *Client) DeleteGuildScheduledEvent(ctx context.Context, guildID objects.SnowflakeObject, ...) error
- func (c *Client) DeleteGuildSticker(ctx context.Context, guildID, id objects.SnowflakeObject, reason ...string) error
- func (c *Client) DeleteGuildTemplate(ctx context.Context, guild objects.SnowflakeObject, code, reason string) (*objects.Template, error)
- func (c *Client) DeleteInvite(ctx context.Context, code, reason string) (*objects.Invite, error)
- func (c *Client) DeleteMessage(ctx context.Context, channel, message objects.SnowflakeObject) error
- func (c *Client) DeleteOriginalInteractionResponse(ctx context.Context, applicationID objects.SnowflakeObject, token string) error
- func (c *Client) DeleteOwnReaction(ctx context.Context, channel, message objects.SnowflakeObject, ...) error
- func (c *Client) DeletePinnedMessage(ctx context.Context, channel, message objects.SnowflakeObject) error
- func (c *Client) DeleteUserReaction(ctx context.Context, channel, message, user objects.SnowflakeObject, ...) error
- func (c *Client) DeleteWebhook(ctx context.Context, id objects.SnowflakeObject) error
- func (c *Client) DeleteWebhookMessage(ctx context.Context, messageID, webhookID objects.SnowflakeObject, ...) error
- func (c *Client) DeleteWebhookWithToken(ctx context.Context, id objects.SnowflakeObject, token string) error
- func (c *Client) EditApplicationCommandPermissions(ctx context.Context, app, guild, cmd objects.SnowflakeObject, ...) (*objects.GuildApplicationCommandPermissions, error)
- func (c *Client) EditChannelPermissions(ctx context.Context, channel, overwrite objects.SnowflakeObject, ...) error
- func (c *Client) EditFollowupMessage(ctx context.Context, applicationID objects.SnowflakeObject, token string, ...) (*objects.Message, error)
- func (c *Client) EditMessage(ctx context.Context, channel, message objects.SnowflakeObject, ...) (*objects.Message, error)
- func (c *Client) EditOriginalInteractionResponse(ctx context.Context, applicationID objects.SnowflakeObject, token string, ...) (*objects.Message, error)
- func (c *Client) EditWebhookMessage(ctx context.Context, messageID, webhookID objects.SnowflakeObject, ...) (*objects.Message, error)
- func (c *Client) ExecuteWebhook(ctx context.Context, id objects.SnowflakeObject, token string, ...) (*objects.Message, error)
- func (c *Client) FollowNewsChannel(ctx context.Context, channel objects.SnowflakeObject) (*objects.FollowedChannel, error)
- func (c *Client) Gateway(ctx context.Context) (*objects.Gateway, error)
- func (c *Client) GatewayBot(ctx context.Context) (*objects.Gateway, error)
- func (c *Client) GetApplicationCommandPermissions(ctx context.Context, app, guild, cmd objects.SnowflakeObject) (*objects.GuildApplicationCommandPermissions, error)
- func (c *Client) GetAuditLogs(ctx context.Context, guild objects.SnowflakeObject, params *GetAuditLogParams) (*objects.AuditLog, error)
- func (c *Client) GetChannel(ctx context.Context, id objects.SnowflakeObject) (*objects.Channel, error)
- func (c *Client) GetChannelInvites(ctx context.Context, channel objects.SnowflakeObject) ([]*objects.Invite, error)
- func (c *Client) GetChannelMessage(ctx context.Context, channel, message objects.SnowflakeObject) (*objects.Message, error)
- func (c *Client) GetChannelMessages(ctx context.Context, id objects.SnowflakeObject, ...) ([]*objects.Message, error)
- func (c *Client) GetChannelWebhooks(ctx context.Context, channel objects.SnowflakeObject) ([]*objects.Webhook, error)
- func (c *Client) GetCommand(ctx context.Context, app, commandID objects.SnowflakeObject) (*objects.ApplicationCommand, error)
- func (c *Client) GetCommands(ctx context.Context, app objects.SnowflakeObject) ([]*objects.ApplicationCommand, error)
- func (c *Client) GetCurrentUser(ctx context.Context) (*objects.User, error)
- func (c *Client) GetCurrentUserGuildMember(ctx context.Context, guild objects.SnowflakeObject) (*objects.GuildMember, error)
- func (c *Client) GetCurrentUserGuilds(ctx context.Context, params *CurrentUserGuildsParams) ([]*objects.Guild, error)
- func (c *Client) GetFollowupMessage(ctx context.Context, applicationID objects.SnowflakeObject, token string, ...) (*objects.Message, error)
- func (c *Client) GetGuild(ctx context.Context, id objects.SnowflakeObject) (*objects.Guild, error)
- func (c *Client) GetGuildApplicationCommandPermissions(ctx context.Context, app, guild objects.SnowflakeObject) ([]*objects.GuildApplicationCommandPermissions, error)
- func (c *Client) GetGuildBan(ctx context.Context, guild, user objects.SnowflakeObject) (*objects.Ban, error)
- func (c *Client) GetGuildBans(ctx context.Context, guild objects.SnowflakeObject) ([]*objects.Ban, error)
- func (c *Client) GetGuildChannels(ctx context.Context, id objects.SnowflakeObject) ([]*objects.Channel, error)
- func (c *Client) GetGuildCommand(ctx context.Context, app, guild, commandID objects.SnowflakeObject) (*objects.ApplicationCommand, error)
- func (c *Client) GetGuildCommands(ctx context.Context, app, guild objects.SnowflakeObject) ([]*objects.ApplicationCommand, error)
- func (c *Client) GetGuildIntegrations(ctx context.Context, guild objects.SnowflakeObject) ([]*objects.Integration, error)
- func (c *Client) GetGuildInvites(ctx context.Context, guild objects.SnowflakeObject) ([]*objects.Invite, error)
- func (c *Client) GetGuildMember(ctx context.Context, guild, user objects.SnowflakeObject) (*objects.GuildMember, error)
- func (c *Client) GetGuildPreview(ctx context.Context, id objects.SnowflakeObject) (*objects.GuildPreview, error)
- func (c *Client) GetGuildPruneCount(ctx context.Context, guild objects.SnowflakeObject, ...) (int, error)
- func (c *Client) GetGuildRoles(ctx context.Context, guild objects.SnowflakeObject) ([]*objects.Role, error)
- func (c *Client) GetGuildScheduledEvent(ctx context.Context, guildID objects.SnowflakeObject, ...) (*objects.GuildScheduledEvent, error)
- func (c *Client) GetGuildScheduledEventUsers(ctx context.Context, guildID objects.SnowflakeObject, ...) ([]*objects.GuildScheduledEventUser, error)
- func (c *Client) GetGuildSticker(ctx context.Context, guildID objects.SnowflakeObject, ...) (*objects.Sticker, error)
- func (c *Client) GetGuildTemplates(ctx context.Context, guild objects.SnowflakeObject) ([]*objects.Template, error)
- func (c *Client) GetGuildVanityURL(ctx context.Context, guild objects.SnowflakeObject) (*objects.Invite, error)
- func (c *Client) GetGuildVoiceRegions(ctx context.Context, guild objects.SnowflakeObject) ([]*objects.VoiceRegion, error)
- func (c *Client) GetGuildWebhooks(ctx context.Context, guild objects.SnowflakeObject) ([]*objects.Webhook, error)
- func (c *Client) GetGuildWelcomeScreen(ctx context.Context, guild objects.SnowflakeObject) (*objects.MembershipScreening, error)
- func (c *Client) GetGuildWidget(ctx context.Context, guild objects.SnowflakeObject) (*objects.GuildWidgetJSON, error)
- func (c *Client) GetGuildWidgetImage(ctx context.Context, guild objects.SnowflakeObject, ...) (image.Image, error)
- func (c *Client) GetGuildWidgetSettings(ctx context.Context, guild objects.SnowflakeObject) (*objects.GuildWidget, error)
- func (c *Client) GetInvite(ctx context.Context, code string, params *GetInviteParams) (*objects.Invite, error)
- func (c *Client) GetOriginalInteractionResponse(ctx context.Context, applicationID objects.SnowflakeObject, token string) (*objects.Message, error)
- func (c *Client) GetPinnedMessages(ctx context.Context, channel objects.SnowflakeObject) ([]*objects.Message, error)
- func (c *Client) GetReactions(ctx context.Context, channel, message objects.SnowflakeObject, ...) ([]*objects.User, error)
- func (c *Client) GetSticker(ctx context.Context, id objects.SnowflakeObject) (*objects.Sticker, error)
- func (c *Client) GetTemplate(ctx context.Context, code string) (*objects.Template, error)
- func (c *Client) GetUser(ctx context.Context, user objects.SnowflakeObject) (*objects.User, error)
- func (c *Client) GetUserConnections(ctx context.Context) ([]*objects.Connection, error)
- func (c *Client) GetVoiceRegions(ctx context.Context) ([]*objects.VoiceRegion, error)
- func (c *Client) GetWebhook(ctx context.Context, id objects.SnowflakeObject) (*objects.Webhook, error)
- func (c *Client) GetWebhookWithToken(ctx context.Context, id objects.SnowflakeObject, token string) (*objects.Webhook, error)
- func (c *Client) JoinThread(ctx context.Context, thread objects.SnowflakeObject) error
- func (c *Client) LeaveGuild(ctx context.Context, guild objects.SnowflakeObject) error
- func (c *Client) LeaveThread(ctx context.Context, thread objects.SnowflakeObject) error
- func (c *Client) ListActiveThreads(ctx context.Context, id objects.SnowflakeObject) ([]*ListThreadsResponse, error)
- func (c *Client) ListGuildMembers(ctx context.Context, guild objects.SnowflakeObject, ...) ([]*objects.GuildMember, error)
- func (c *Client) ListGuildStickers(ctx context.Context, guildID objects.SnowflakeObject) ([]*objects.Sticker, error)
- func (c *Client) ListJoinedPrivateArchivedThreads(ctx context.Context, channel objects.SnowflakeObject, ...) (*ListThreadsResponse, error)
- func (c *Client) ListNitroStickerPacks(ctx context.Context) ([]*objects.StickerPack, error)
- func (c *Client) ListPrivateArchivedThreads(ctx context.Context, channel objects.SnowflakeObject, ...) (*ListThreadsResponse, error)
- func (c *Client) ListPublicArchivedThreads(ctx context.Context, channel objects.SnowflakeObject, ...) (*ListThreadsResponse, error)
- func (c *Client) ListThreadMembers(ctx context.Context, thread objects.SnowflakeObject) ([]*objects.ThreadMember, error)
- func (c *Client) ModifyChannel(ctx context.Context, id objects.SnowflakeObject, params *ModifyChannelParams) (*objects.Channel, error)
- func (c *Client) ModifyCurrentUser(ctx context.Context, params *ModifyCurrentUserParams) (*objects.User, error)
- func (c *Client) ModifyCurrentUserNick(ctx context.Context, guild objects.SnowflakeObject, ...) (*ModifyCurrentUserNickParams, error)
- func (c *Client) ModifyGuild(ctx context.Context, id objects.SnowflakeObject, params *ModifyGuildParams) (*objects.Guild, error)
- func (c *Client) ModifyGuildChannelPositions(ctx context.Context, id objects.SnowflakeObject, ...) error
- func (c *Client) ModifyGuildMember(ctx context.Context, guild, member objects.SnowflakeObject, ...) (*objects.GuildMember, error)
- func (c *Client) ModifyGuildRole(ctx context.Context, guild, role objects.SnowflakeObject, ...) (*objects.Role, error)
- func (c *Client) ModifyGuildRolePositions(ctx context.Context, guild objects.SnowflakeObject, ...) ([]*objects.Role, error)
- func (c *Client) ModifyGuildScheduledEvent(ctx context.Context, guildID objects.SnowflakeObject, ...) (*objects.GuildScheduledEvent, error)
- func (c *Client) ModifyGuildSticker(ctx context.Context, guildID, id objects.SnowflakeObject, ...) (*objects.Sticker, error)
- func (c *Client) ModifyGuildTemplate(ctx context.Context, guild objects.SnowflakeObject, code string, ...) (*objects.Template, error)
- func (c *Client) ModifyGuildWelcomeScreen(ctx context.Context, guild objects.SnowflakeObject, ...) (*objects.MembershipScreening, error)
- func (c *Client) ModifyGuildWidget(ctx context.Context, guild objects.SnowflakeObject, params *GuildWidgetParams) (*objects.GuildWidget, error)
- func (c *Client) ModifyWebhook(ctx context.Context, id objects.SnowflakeObject, params *ModifyWebhookParams) (*objects.Webhook, error)
- func (c *Client) ModifyWebhookWithToken(ctx context.Context, id objects.SnowflakeObject, token string, ...) (*objects.Webhook, error)
- func (c *Client) RemoveGuildBan(ctx context.Context, guild, user objects.SnowflakeObject, reason string) error
- func (c *Client) RemoveGuildMember(ctx context.Context, guild, user objects.SnowflakeObject, reason string) error
- func (c *Client) RemoveGuildMemberRole(ctx context.Context, guild, user, role objects.SnowflakeObject, reason string) error
- func (c *Client) RemoveThreadMember(ctx context.Context, thread, user objects.SnowflakeObject) error
- func (c *Client) StartThread(ctx context.Context, channel objects.SnowflakeObject, ...) (*objects.Channel, error)
- func (c *Client) StartThreadWithMessage(ctx context.Context, channel, message objects.SnowflakeObject, ...) (*objects.Channel, error)
- func (c *Client) StartTyping(ctx context.Context, channel objects.SnowflakeObject) error
- func (c *Client) SyncGuildTemplate(ctx context.Context, guild objects.SnowflakeObject, code string) (*objects.Template, error)
- func (c *Client) UpdateCommand(ctx context.Context, app, commandID objects.SnowflakeObject, ...) (*objects.ApplicationCommand, error)
- func (c *Client) UpdateGuildCommand(ctx context.Context, app, guild, commandID objects.SnowflakeObject, ...) (*objects.ApplicationCommand, error)
- type Config
- type CreateDMParams
- type CreateFollowupMessageParams
- type CreateGroupDMParams
- type CreateGuildBanParams
- type CreateGuildParams
- type CreateGuildRoleParams
- type CreateGuildScheduledEventParams
- type CreateGuildStickerParams
- type CreateGuildTemplateParams
- type CreateInviteParams
- type CreateMessageParams
- type CreateWebhookParams
- type CurrentUserGuildsParams
- type DefaultHTTPClient
- type DeleteMessagesParams
- type DiscordResponse
- type Doer
- type EditChannelParams
- type EditMessageParams
- type EditWebhookMessageParams
- type ErrorREST
- type ExecuteWebhookParams
- type GetAuditLogParams
- type GetChannelMessagesParams
- type GetGuildPruneCountParams
- type GetGuildScheduledEventParams
- type GetGuildScheduledEventUsersParams
- type GetInviteParams
- type GetReactionsParams
- type GuildWidgetImageParams
- type GuildWidgetParams
- type HTTPClient
- type LeakyBucketRatelimiter
- type ListGuildMembersParams
- type ListThreadsParams
- type ListThreadsResponse
- type MemoryCache
- type MemoryCacheConfig
- type MemoryConf
- type MemoryRatelimiter
- type ModifyChannelParams
- type ModifyChannelPositionParams
- type ModifyCurrentUserNickParams
- type ModifyCurrentUserParams
- type ModifyGuildMemberParams
- type ModifyGuildMembershipScreeningParams
- type ModifyGuildParams
- type ModifyGuildRoleParams
- type ModifyGuildRolePositionsParams
- type ModifyGuildScheduledEventParams
- type ModifyGuildTemplateParams
- type ModifyWebhookParams
- type ModifyWebhookWithTokenParams
- type ProxyClient
- type RESTClient
- type Ratelimiter
- type RedisConf
- type RedisRatelimiter
- type StartThreadParams
- type TestHTTPClient
Constants ¶
View Source
const ( // Discord API Base URL BaseURL = "https://discord.com/api/v9" XAuditLogReasonHeader = "X-Audit-Log-Reason" JsonContentType = "application/json" // Channels ChannelBaseFmt = BaseURL + "/channels/%d" ChannelMessagesFmt = ChannelBaseFmt + "/messages" ChannelMessageFmt = ChannelMessagesFmt + "/%d" CrosspostMessageFmt = ChannelMessageFmt + "/crosspost" ReactionsBaseFmt = ChannelMessageFmt + "/reactions" ReactionsFmt = ReactionsBaseFmt + "/%s" ReactionFmt = ReactionsFmt + "/%s" ReactionUserFmt = ReactionsFmt + "/%d" BulkDeleteMessagesFmt = ChannelMessagesFmt + "/bulk-delete" ChannelPermissionsFmt = ChannelBaseFmt + "/permissions/%d" ChannelInvitesFmt = ChannelBaseFmt + "/invites" ChannelPinsFmt = ChannelBaseFmt + "/pins" ChannelPinnedFmt = ChannelPinsFmt + "/%d" ChannelFollowersFmt = ChannelBaseFmt + "/followers" ChannelTypingFmt = ChannelBaseFmt + "/typing" ChannelMessageThreadsFmt = ChannelMessageFmt + "/threads" ChannelThreadsFmt = ChannelBaseFmt + "/threads" ChannelThreadMembersFmt = ChannelBaseFmt + "/thread-members" ChannelThreadMembersUserFmt = ChannelThreadMembersFmt + "/%d" ChannelThreadMembersMeFmt = ChannelThreadMembersFmt + "/@me" ChannelThreadsActiveFmt = ChannelThreadsFmt + "/active" ChannelThreadsArchivedFmt = ChannelThreadsFmt + "/archived" ChannelThreadsArchivedPublicFmt = ChannelThreadsArchivedFmt + "/public" ChannelThreadsArchivedPrivateFmt = ChannelThreadsArchivedFmt + "/private" ChannelUsersMeThreadsArchivedFmt = ChannelBaseFmt + "/users/@me/threads/archived/private" // Commands ApplicationFmt = BaseURL + "/applications" GlobalApplicationsFmt = ApplicationFmt + "/%d/commands" GlobalApplicationsUpdateFmt = GlobalApplicationsFmt + "/%d" GuildApplicationsFmt = ApplicationFmt + "/%d/guilds/%d/commands" GuildApplicationsUpdateFmt = GuildApplicationsFmt + "/%d" // Guilds GuildBaseFmt = BaseURL + "/guilds/%d" GuildCreateFmt = BaseURL + "/guilds" GuildChannelsFmt = GuildBaseFmt + "/channels" GuildPreviewFmt = GuildBaseFmt + "/preview" GuildAuditLogsFmt = GuildBaseFmt + "/audit-logs" GuildMembersFmt = GuildBaseFmt + "/members" GuildMemberFmt = GuildMembersFmt + "/%d" GuildMemberEditCurrentUserNickFmt = GuildMembersFmt + "/@me/nick" GuildBansFmt = GuildBaseFmt + "/bans" GuildBanUserFmt = GuildBansFmt + "/%d" GuildPruneFmt = GuildBaseFmt + "/prune" GuildVoiceRegionsFmt = GuildBaseFmt + "/regions" GuildInvitesFmt = GuildBaseFmt + "/invites" GuildWidgetFmt = GuildBaseFmt + "/widget" GuildWidgetJSONFmt = GuildWidgetFmt + ".json" GuildVanityURLFmt = GuildBaseFmt + "/vanity-url" GuildWidgetImageFmt = GuildWidgetFmt + ".png" GuildMembershipScreeningFmt = GuildBaseFmt + "/member-verification" GuildThreadsFmt = GuildBaseFmt + "/threads/active" // Scheduled Events GuildScheduledEventBaseFmt = GuildBaseFmt + "/scheduled-events" GuildScheduledEventFmt = GuildScheduledEventBaseFmt + "/%d" GuildScheduledEventUsersFmt = GuildScheduledEventFmt + "/users" // Roles GuildMemberRoleFmt = GuildBaseFmt + "/members/%d/roles/%d" GuildRolesFmt = GuildBaseFmt + "/roles" GuildRoleFmt = GuildRolesFmt + "/%d" // Integrations IntegrationsBaseFmt = GuildBaseFmt + "/integrations" IntegrationBaseFmt = IntegrationsBaseFmt + "/%d" IntegrationSync = IntegrationBaseFmt + "/sync" // Invites InviteFmt = BaseURL + "/invites/%s" // Templates TemplateFmt = BaseURL + "/guilds/templates/%s" GuildTemplateFmt = BaseURL + "/guilds/%d/templates" GuildTemplatesFmt = GuildTemplateFmt + "/%s" // Stickers StickerFmt = BaseURL + "/stickers/%d" NitroStickerFmt = BaseURL + "/sticker-packs" GuildStickersFmt = GuildBaseFmt + "/stickers" GuildStickerFmt = GuildStickersFmt + "/%d" // Users UsersFmt = BaseURL + "/users" UsersMeFmt = UsersFmt + "/@me" UsersMeGuilds = UsersMeFmt + "/guilds" UsersMeGuild = UsersMeGuilds + "/%d" UsersMeGuildMember = UsersMeGuild + "/member" UsersMeChannels = UsersMeFmt + "/channels" UserFmt = UsersFmt + "/%d" UserConnections = UsersMeFmt + "/connections" // Voice VoiceRegions = BaseURL + "/voice/regions" // Webhooks ChannelWebhookFmt = BaseURL + "/channels/%d/webhooks" GuildWebhookFmt = BaseURL + "/guilds/%d/webhooks" WebhookFmt = BaseURL + "/webhooks/%d" WebhookWithTokenFmt = WebhookFmt + "/%s" WebhookMessageFmt = WebhookWithTokenFmt + "/messages/%d" // Interactions CreateInteractionResponseFmt = BaseURL + "/interactions/%d/%s/callback" OriginalInteractionResponseFmt = WebhookWithTokenFmt + "/messages/@original" // Permissions GuildApplicationCommandsPermissionsFmt = GuildApplicationsFmt + "/permissions" GuildApplicationCommandPermissionsFmt = GuildApplicationsFmt + "/%d/permissions" // Gateway GatewayFmt = BaseURL + "/gateway" GatewayBotFmt = GatewayFmt + "/bot" )
Variables ¶
View Source
var ErrMaxRetriesExceeded = errors.New("max retries exceeded")
Functions ¶
func NewRequest ¶
func NewRequest() *request
Types ¶
type AddGuildMemberParams ¶
type BaseStickerParams ¶ added in v0.1.0
type BeginGuildPruneParams ¶
type Cache ¶
type Cache interface { Get(key string) (*DiscordResponse, error) Put(key string, value *DiscordResponse) error }
type CacheError ¶
type CacheError struct {
// contains filtered or unexported fields
}
func (*CacheError) Error ¶
func (c *CacheError) Error() string
type CacheValue ¶
type CacheValue struct {
// contains filtered or unexported fields
}
type ChannelCreateParams ¶
type ChannelCreateParams struct { Name string `json:"name"` Type objects.ChannelType `json:"type,omitempty"` Topic string `json:"topic,omitempty"` Bitrate int `json:"bitrate,omitempty"` UserLimit int `json:"user_limit,omitempty"` RateLimitPerUser int `json:"rate_limit_per_user,omitempty"` Position int `json:"position,omitempty"` PermissionOverwrites []*objects.PermissionOverwrite `json:"permission_overwrites,omitempty"` ParentID objects.Snowflake `json:"parent_id,omitempty"` NSFW bool `json:"nsfw,omitempty"` Reason string `json:"-"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddGuildCommand ¶
func (c *Client) AddGuildCommand(ctx context.Context, app, guild objects.SnowflakeObject, command *objects.ApplicationCommand) (*objects.ApplicationCommand, error)
func (*Client) AddGuildMember ¶
func (c *Client) AddGuildMember(ctx context.Context, guild, user objects.SnowflakeObject, params *AddGuildMemberParams) (*objects.GuildMember, error)
func (*Client) AddGuildMemberRole ¶
func (*Client) AddPinnedMessage ¶
func (*Client) AddThreadMember ¶
func (*Client) BatchEditApplicationCommandPermissions ¶
func (c *Client) BatchEditApplicationCommandPermissions(ctx context.Context, app, guild objects.SnowflakeObject, permissions []*objects.GuildApplicationCommandPermissions) ([]*objects.GuildApplicationCommandPermissions, error)
func (*Client) BeginGuildPrune ¶
func (c *Client) BeginGuildPrune(ctx context.Context, guild objects.SnowflakeObject, params *BeginGuildPruneParams) (int, error)
func (*Client) BulkDeleteMessages ¶
func (c *Client) BulkDeleteMessages(ctx context.Context, channel objects.SnowflakeObject, params *DeleteMessagesParams) error
func (*Client) BulkOverwriteGlobalCommands ¶
func (c *Client) BulkOverwriteGlobalCommands(ctx context.Context, app objects.SnowflakeObject, commands []*objects.ApplicationCommand) ([]*objects.ApplicationCommand, error)
func (*Client) BulkOverwriteGuildCommands ¶
func (c *Client) BulkOverwriteGuildCommands(ctx context.Context, application, guild objects.SnowflakeObject, commands []*objects.ApplicationCommand) ([]*objects.ApplicationCommand, error)
func (*Client) CreateBan ¶
func (c *Client) CreateBan(ctx context.Context, guild, user objects.SnowflakeObject, params *CreateGuildBanParams) error
func (*Client) CreateChannelInvite ¶
func (c *Client) CreateChannelInvite(ctx context.Context, channel objects.SnowflakeObject, params *CreateInviteParams) (*objects.Invite, error)
func (*Client) CreateCommand ¶
func (c *Client) CreateCommand(ctx context.Context, app objects.SnowflakeObject, command *objects.ApplicationCommand) (*objects.ApplicationCommand, error)
func (*Client) CreateFollowupMessage ¶
func (c *Client) CreateFollowupMessage(ctx context.Context, applicationID objects.SnowflakeObject, token string, params *CreateFollowupMessageParams) (*objects.Message, error)
func (*Client) CreateGroupDM ¶
func (*Client) CreateGuild ¶
func (*Client) CreateGuildChannel ¶
func (c *Client) CreateGuildChannel(ctx context.Context, id objects.SnowflakeObject, params *ChannelCreateParams) (*objects.Channel, error)
func (*Client) CreateGuildFromTemplate ¶
func (*Client) CreateGuildRole ¶
func (c *Client) CreateGuildRole(ctx context.Context, guild objects.SnowflakeObject, params *CreateGuildRoleParams) (*objects.Role, error)
func (*Client) CreateGuildScheduledEvent ¶ added in v0.1.0
func (c *Client) CreateGuildScheduledEvent(ctx context.Context, guildID objects.SnowflakeObject, params *CreateGuildScheduledEventParams) (*objects.GuildScheduledEvent, error)
func (*Client) CreateGuildSticker ¶ added in v0.1.0
func (c *Client) CreateGuildSticker(ctx context.Context, guildID objects.SnowflakeObject, params *CreateGuildStickerParams) (*objects.Sticker, error)
func (*Client) CreateGuildTemplate ¶
func (c *Client) CreateGuildTemplate(ctx context.Context, guild objects.SnowflakeObject, params *CreateGuildTemplateParams) (*objects.Template, error)
func (*Client) CreateInteractionResponse ¶
func (c *Client) CreateInteractionResponse(ctx context.Context, interactionID objects.SnowflakeObject, token string, response *objects.InteractionResponse) error
func (*Client) CreateMessage ¶
func (c *Client) CreateMessage(ctx context.Context, channel objects.SnowflakeObject, params *CreateMessageParams) (*objects.Message, error)
func (*Client) CreateReaction ¶
func (*Client) CreateWebhook ¶
func (c *Client) CreateWebhook(ctx context.Context, channel objects.SnowflakeObject, params *CreateWebhookParams) (*objects.Webhook, error)
func (*Client) CrossPostMessage ¶
func (*Client) DeleteAllReactions ¶
func (*Client) DeleteChannel ¶
func (*Client) DeleteChannelPermission ¶
func (*Client) DeleteCommand ¶
func (*Client) DeleteEmojiReactions ¶
func (*Client) DeleteFollowupMessage ¶
func (c *Client) DeleteFollowupMessage(ctx context.Context, applicationID objects.SnowflakeObject, token string, messageID objects.SnowflakeObject) error
func (*Client) DeleteGuild ¶
func (*Client) DeleteGuildCommand ¶
func (*Client) DeleteGuildIntegration ¶
func (*Client) DeleteGuildRole ¶
func (*Client) DeleteGuildScheduledEvent ¶ added in v0.1.0
func (c *Client) DeleteGuildScheduledEvent(ctx context.Context, guildID objects.SnowflakeObject, id objects.SnowflakeObject) error
func (*Client) DeleteGuildSticker ¶ added in v0.1.0
func (*Client) DeleteGuildTemplate ¶
func (*Client) DeleteInvite ¶
func (*Client) DeleteMessage ¶
func (*Client) DeleteOriginalInteractionResponse ¶
func (*Client) DeleteOwnReaction ¶
func (*Client) DeletePinnedMessage ¶
func (*Client) DeleteUserReaction ¶
func (*Client) DeleteWebhook ¶
func (*Client) DeleteWebhookMessage ¶
func (*Client) DeleteWebhookWithToken ¶
func (*Client) EditApplicationCommandPermissions ¶
func (c *Client) EditApplicationCommandPermissions(ctx context.Context, app, guild, cmd objects.SnowflakeObject, permissions []*objects.ApplicationCommandPermissions) (*objects.GuildApplicationCommandPermissions, error)
func (*Client) EditChannelPermissions ¶
func (c *Client) EditChannelPermissions(ctx context.Context, channel, overwrite objects.SnowflakeObject, params *EditChannelParams) error
func (*Client) EditFollowupMessage ¶
func (c *Client) EditFollowupMessage(ctx context.Context, applicationID objects.SnowflakeObject, token string, messageID objects.SnowflakeObject, params *EditWebhookMessageParams) (*objects.Message, error)
func (*Client) EditMessage ¶
func (c *Client) EditMessage(ctx context.Context, channel, message objects.SnowflakeObject, params *EditMessageParams) (*objects.Message, error)
func (*Client) EditOriginalInteractionResponse ¶
func (c *Client) EditOriginalInteractionResponse(ctx context.Context, applicationID objects.SnowflakeObject, token string, params *EditWebhookMessageParams) (*objects.Message, error)
func (*Client) EditWebhookMessage ¶
func (c *Client) EditWebhookMessage(ctx context.Context, messageID, webhookID objects.SnowflakeObject, token string, params *EditWebhookMessageParams) (*objects.Message, error)
func (*Client) ExecuteWebhook ¶
func (c *Client) ExecuteWebhook(ctx context.Context, id objects.SnowflakeObject, token string, params *ExecuteWebhookParams) (*objects.Message, error)
func (*Client) FollowNewsChannel ¶
func (c *Client) FollowNewsChannel(ctx context.Context, channel objects.SnowflakeObject) (*objects.FollowedChannel, error)
func (*Client) GatewayBot ¶ added in v0.0.10
func (*Client) GetApplicationCommandPermissions ¶
func (c *Client) GetApplicationCommandPermissions(ctx context.Context, app, guild, cmd objects.SnowflakeObject) (*objects.GuildApplicationCommandPermissions, error)
func (*Client) GetAuditLogs ¶
func (c *Client) GetAuditLogs(ctx context.Context, guild objects.SnowflakeObject, params *GetAuditLogParams) (*objects.AuditLog, error)
func (*Client) GetChannel ¶
func (*Client) GetChannelInvites ¶
func (*Client) GetChannelMessage ¶
func (*Client) GetChannelMessages ¶
func (c *Client) GetChannelMessages(ctx context.Context, id objects.SnowflakeObject, params *GetChannelMessagesParams) ([]*objects.Message, error)
func (*Client) GetChannelWebhooks ¶
func (*Client) GetCommand ¶
func (c *Client) GetCommand(ctx context.Context, app, commandID objects.SnowflakeObject) (*objects.ApplicationCommand, error)
func (*Client) GetCommands ¶
func (c *Client) GetCommands(ctx context.Context, app objects.SnowflakeObject) ([]*objects.ApplicationCommand, error)
func (*Client) GetCurrentUser ¶
func (*Client) GetCurrentUserGuildMember ¶ added in v0.1.0
func (c *Client) GetCurrentUserGuildMember(ctx context.Context, guild objects.SnowflakeObject) (*objects.GuildMember, error)
func (*Client) GetCurrentUserGuilds ¶
func (*Client) GetFollowupMessage ¶
func (*Client) GetGuildApplicationCommandPermissions ¶
func (c *Client) GetGuildApplicationCommandPermissions(ctx context.Context, app, guild objects.SnowflakeObject) ([]*objects.GuildApplicationCommandPermissions, error)
func (*Client) GetGuildBan ¶
func (*Client) GetGuildBans ¶
func (*Client) GetGuildChannels ¶
func (*Client) GetGuildCommand ¶
func (c *Client) GetGuildCommand(ctx context.Context, app, guild, commandID objects.SnowflakeObject) (*objects.ApplicationCommand, error)
func (*Client) GetGuildCommands ¶
func (c *Client) GetGuildCommands(ctx context.Context, app, guild objects.SnowflakeObject) ([]*objects.ApplicationCommand, error)
func (*Client) GetGuildIntegrations ¶
func (c *Client) GetGuildIntegrations(ctx context.Context, guild objects.SnowflakeObject) ([]*objects.Integration, error)
func (*Client) GetGuildInvites ¶
func (*Client) GetGuildMember ¶
func (c *Client) GetGuildMember(ctx context.Context, guild, user objects.SnowflakeObject) (*objects.GuildMember, error)
func (*Client) GetGuildPreview ¶
func (c *Client) GetGuildPreview(ctx context.Context, id objects.SnowflakeObject) (*objects.GuildPreview, error)
func (*Client) GetGuildPruneCount ¶
func (c *Client) GetGuildPruneCount(ctx context.Context, guild objects.SnowflakeObject, params *GetGuildPruneCountParams) (int, error)
func (*Client) GetGuildRoles ¶
func (*Client) GetGuildScheduledEvent ¶ added in v0.1.0
func (c *Client) GetGuildScheduledEvent(ctx context.Context, guildID objects.SnowflakeObject, id objects.SnowflakeObject, params ...*GetGuildScheduledEventParams) (*objects.GuildScheduledEvent, error)
func (*Client) GetGuildScheduledEventUsers ¶ added in v0.1.0
func (c *Client) GetGuildScheduledEventUsers(ctx context.Context, guildID objects.SnowflakeObject, id objects.SnowflakeObject, params ...*GetGuildScheduledEventUsersParams) ([]*objects.GuildScheduledEventUser, error)
func (*Client) GetGuildSticker ¶ added in v0.1.0
func (c *Client) GetGuildSticker(ctx context.Context, guildID objects.SnowflakeObject, stickerID objects.SnowflakeObject) (*objects.Sticker, error)
func (*Client) GetGuildTemplates ¶
func (*Client) GetGuildVanityURL ¶
func (*Client) GetGuildVoiceRegions ¶
func (c *Client) GetGuildVoiceRegions(ctx context.Context, guild objects.SnowflakeObject) ([]*objects.VoiceRegion, error)
func (*Client) GetGuildWebhooks ¶
func (*Client) GetGuildWelcomeScreen ¶
func (c *Client) GetGuildWelcomeScreen(ctx context.Context, guild objects.SnowflakeObject) (*objects.MembershipScreening, error)
func (*Client) GetGuildWidget ¶
func (c *Client) GetGuildWidget(ctx context.Context, guild objects.SnowflakeObject) (*objects.GuildWidgetJSON, error)
func (*Client) GetGuildWidgetImage ¶
func (c *Client) GetGuildWidgetImage(ctx context.Context, guild objects.SnowflakeObject, params *GuildWidgetImageParams) (image.Image, error)
func (*Client) GetGuildWidgetSettings ¶
func (c *Client) GetGuildWidgetSettings(ctx context.Context, guild objects.SnowflakeObject) (*objects.GuildWidget, error)
func (*Client) GetOriginalInteractionResponse ¶
func (*Client) GetPinnedMessages ¶
func (*Client) GetReactions ¶
func (c *Client) GetReactions(ctx context.Context, channel, message objects.SnowflakeObject, emoji interface{}, params *GetReactionsParams) ([]*objects.User, error)
func (*Client) GetSticker ¶ added in v0.1.0
func (*Client) GetTemplate ¶
func (*Client) GetUserConnections ¶
func (*Client) GetVoiceRegions ¶
func (*Client) GetWebhook ¶
func (*Client) GetWebhookWithToken ¶
func (*Client) JoinThread ¶
func (*Client) LeaveGuild ¶
func (*Client) LeaveThread ¶
func (*Client) ListActiveThreads ¶
func (c *Client) ListActiveThreads(ctx context.Context, id objects.SnowflakeObject) ([]*ListThreadsResponse, error)
func (*Client) ListGuildMembers ¶
func (c *Client) ListGuildMembers(ctx context.Context, guild objects.SnowflakeObject, params *ListGuildMembersParams) ([]*objects.GuildMember, error)
func (*Client) ListGuildStickers ¶ added in v0.1.0
func (*Client) ListJoinedPrivateArchivedThreads ¶
func (c *Client) ListJoinedPrivateArchivedThreads(ctx context.Context, channel objects.SnowflakeObject, params ...*ListThreadsParams) (*ListThreadsResponse, error)
func (*Client) ListNitroStickerPacks ¶ added in v0.1.0
func (*Client) ListPrivateArchivedThreads ¶
func (c *Client) ListPrivateArchivedThreads(ctx context.Context, channel objects.SnowflakeObject, params ...*ListThreadsParams) (*ListThreadsResponse, error)
func (*Client) ListPublicArchivedThreads ¶
func (c *Client) ListPublicArchivedThreads(ctx context.Context, channel objects.SnowflakeObject, params ...*ListThreadsParams) (*ListThreadsResponse, error)
func (*Client) ListThreadMembers ¶
func (c *Client) ListThreadMembers(ctx context.Context, thread objects.SnowflakeObject) ([]*objects.ThreadMember, error)
func (*Client) ModifyChannel ¶
func (c *Client) ModifyChannel(ctx context.Context, id objects.SnowflakeObject, params *ModifyChannelParams) (*objects.Channel, error)
func (*Client) ModifyCurrentUser ¶
func (*Client) ModifyCurrentUserNick ¶
func (c *Client) ModifyCurrentUserNick(ctx context.Context, guild objects.SnowflakeObject, params *ModifyCurrentUserNickParams) (*ModifyCurrentUserNickParams, error)
func (*Client) ModifyGuild ¶
func (c *Client) ModifyGuild(ctx context.Context, id objects.SnowflakeObject, params *ModifyGuildParams) (*objects.Guild, error)
func (*Client) ModifyGuildChannelPositions ¶
func (c *Client) ModifyGuildChannelPositions(ctx context.Context, id objects.SnowflakeObject, params []*ModifyChannelPositionParams, reason string) error
func (*Client) ModifyGuildMember ¶
func (c *Client) ModifyGuildMember(ctx context.Context, guild, member objects.SnowflakeObject, params *ModifyGuildMemberParams) (*objects.GuildMember, error)
func (*Client) ModifyGuildRole ¶
func (c *Client) ModifyGuildRole(ctx context.Context, guild, role objects.SnowflakeObject, params *ModifyGuildRoleParams) (*objects.Role, error)
func (*Client) ModifyGuildRolePositions ¶
func (c *Client) ModifyGuildRolePositions(ctx context.Context, guild objects.SnowflakeObject, params []*ModifyGuildRolePositionsParams) ([]*objects.Role, error)
func (*Client) ModifyGuildScheduledEvent ¶ added in v0.1.0
func (c *Client) ModifyGuildScheduledEvent(ctx context.Context, guildID objects.SnowflakeObject, id objects.SnowflakeObject, params *ModifyGuildScheduledEventParams) (*objects.GuildScheduledEvent, error)
func (*Client) ModifyGuildSticker ¶ added in v0.1.0
func (c *Client) ModifyGuildSticker(ctx context.Context, guildID, id objects.SnowflakeObject, params *BaseStickerParams) (*objects.Sticker, error)
func (*Client) ModifyGuildTemplate ¶
func (c *Client) ModifyGuildTemplate(ctx context.Context, guild objects.SnowflakeObject, code string, params *ModifyGuildTemplateParams) (*objects.Template, error)
func (*Client) ModifyGuildWelcomeScreen ¶
func (c *Client) ModifyGuildWelcomeScreen(ctx context.Context, guild objects.SnowflakeObject, params *ModifyGuildMembershipScreeningParams) (*objects.MembershipScreening, error)
func (*Client) ModifyGuildWidget ¶
func (c *Client) ModifyGuildWidget(ctx context.Context, guild objects.SnowflakeObject, params *GuildWidgetParams) (*objects.GuildWidget, error)
func (*Client) ModifyWebhook ¶
func (c *Client) ModifyWebhook(ctx context.Context, id objects.SnowflakeObject, params *ModifyWebhookParams) (*objects.Webhook, error)
func (*Client) ModifyWebhookWithToken ¶
func (c *Client) ModifyWebhookWithToken(ctx context.Context, id objects.SnowflakeObject, token string, params *ModifyWebhookWithTokenParams) (*objects.Webhook, error)
func (*Client) RemoveGuildBan ¶
func (*Client) RemoveGuildMember ¶
func (*Client) RemoveGuildMemberRole ¶
func (*Client) RemoveThreadMember ¶
func (*Client) StartThread ¶
func (c *Client) StartThread(ctx context.Context, channel objects.SnowflakeObject, params *StartThreadParams) (*objects.Channel, error)
func (*Client) StartThreadWithMessage ¶
func (c *Client) StartThreadWithMessage(ctx context.Context, channel, message objects.SnowflakeObject, params *StartThreadParams) (*objects.Channel, error)
func (*Client) StartTyping ¶
func (*Client) SyncGuildTemplate ¶
func (*Client) UpdateCommand ¶
func (c *Client) UpdateCommand(ctx context.Context, app, commandID objects.SnowflakeObject, command *objects.ApplicationCommand) (*objects.ApplicationCommand, error)
func (*Client) UpdateGuildCommand ¶
func (c *Client) UpdateGuildCommand(ctx context.Context, app, guild, commandID objects.SnowflakeObject, command *objects.ApplicationCommand) (*objects.ApplicationCommand, error)
type CreateDMParams ¶
type CreateFollowupMessageParams ¶
type CreateFollowupMessageParams struct { Content string `json:"content,omitempty" url:"-"` TTS bool `json:"tts,omitempty" url:"-"` Files []*objects.DiscordFile `json:"-" url:"-"` Embeds []*objects.Embed `json:"embeds,omitempty" url:"-"` AllowedMentions *objects.AllowedMentions `json:"allowed_mentions,omitempty" url:"-"` Components []*objects.Component `json:"components,omitempty" url:"-"` Attachments []*objects.Attachment `json:"attachments,omitempty" url:"-"` Flags objects.MessageFlag `json:"flags,omitempty" url:"-"` }
type CreateGroupDMParams ¶
type CreateGuildBanParams ¶
type CreateGuildParams ¶
type CreateGuildParams struct { Name string `json:"name"` Region string `json:"region,omitempty"` Icon string `json:"icon,omitempty"` VerificationLevel *objects.VerificationLevel `json:"verification_level,omitempty"` DefaultMessageNotifications *objects.MessageNotificationsLevel `json:"default_message_notifications,omitempty"` ExplicitContentFilter *objects.ExplicitContentFilterLevel `json:"explicit_content_filter,omitempty"` Roles []*objects.Role `json:"roles,omitempty"` Channels []*objects.Channel `json:"channels,omitempty"` AFKChannelID objects.Snowflake `json:"afk_channel_id,omitempty"` AFKTimeout int64 `json:"afk_timeout,omitempty"` SystemChannelID objects.Snowflake `json:"system_channel_id,omitempty"` Reason string `json:"-"` }
type CreateGuildRoleParams ¶
type CreateGuildRoleParams struct { Name string `json:"name,omitempty"` Permissions permissions.PermissionBit `json:"permissions,omitempty"` Color int `json:"color,omitempty"` Hoist bool `json:"hoist,omitempty"` Mentionable bool `json:"mentionable,omitempty"` Reason string `json:"-"` }
type CreateGuildScheduledEventParams ¶ added in v0.1.0
type CreateGuildScheduledEventParams struct { ChannelID *objects.Snowflake `json:"channel_id,omitempty"` EntityMetadata *objects.GuildScheduledEventEntityMetadata `json:"entity_metadata,omitempty"` Name string `json:"name"` PrivacyLevel objects.PrivacyLevel `json:"privacy_level"` ScheduledStartTime objects.Time `json:"scheduled_start_time"` ScheduledEndTime *objects.Time `json:"scheduled_end_time,omitempty"` Description string `json:"description,omitempty"` EntityType objects.GuildScheduledEventEntityType `json:"entity_type"` Image []byte `json:"image,omitempty"` Reason string `json:"-"` }
type CreateGuildStickerParams ¶ added in v0.1.0
type CreateGuildStickerParams struct { BaseStickerParams File io.Reader }
type CreateInviteParams ¶
type CreateInviteParams struct { MaxAge int64 `json:"max_age,omitempty"` MaxUses int64 `json:"max_uses,omitempty"` Temporary bool `json:"temporary,,omitempty"` Unique bool `json:"unique,omitempty"` TargetUser objects.Snowflake `json:"target_user_id,omitempty"` TargetType objects.InviteTargetType `json:"target_type,omitempty"` TargetApplication objects.Snowflake `json:"target_application_id,omitempty"` Reason string `json:"-"` }
type CreateMessageParams ¶
type CreateMessageParams struct { Content string `json:"content,omitempty"` TTS bool `json:"tts,omitempty"` Embeds []*objects.Embed `json:"embeds,omitempty"` AllowedMentions *objects.AllowedMentions `json:"allowed_mentions,omitempty"` MessageReference *objects.MessageReference `json:"message_reference,omitempty"` Components []*objects.Component `json:"components,omitempty"` StickerIDs []objects.Snowflake `json:"sticker_ids,omitempty"` Attachments []*objects.Attachment `json:"attachments,omitempty"` Flags objects.MessageFlag `json:"flags,omitempty"` Files []*objects.DiscordFile `json:"-"` }
type CreateWebhookParams ¶
type CurrentUserGuildsParams ¶
type DefaultHTTPClient ¶
type DefaultHTTPClient struct {
// contains filtered or unexported fields
}
func (*DefaultHTTPClient) Request ¶
func (c *DefaultHTTPClient) Request(req *request) (*DiscordResponse, error)
type DeleteMessagesParams ¶
type DiscordResponse ¶
func (*DiscordResponse) JSON ¶
func (r *DiscordResponse) JSON(v interface{}) error
type EditChannelParams ¶
type EditChannelParams struct { Allow permissions.PermissionBit `json:"allow"` Deny permissions.PermissionBit `json:"deny"` Type int `json:"type"` Reason string `json:"-"` }
type EditMessageParams ¶
type EditMessageParams struct { Content string `json:"content"` Embed *objects.Embed `json:"embed"` Flags objects.MessageFlag `json:"flags,omitempty"` AllowedMentions *objects.AllowedMentions `json:"allowed_mentions,omitempty"` Components []*objects.Component `json:"components"` }
type ExecuteWebhookParams ¶
type ExecuteWebhookParams struct { Wait bool `json:"-" url:"wait"` ThreadID objects.Snowflake `json:"-" url:"thread_id,omitempty"` Content string `json:"content,omitempty" url:"-"` Username string `json:"username,omitempty" url:"-"` AvatarURL string `json:"avatar_url,omitempty" url:"-"` TTS bool `json:"tts,omitempty" url:"-"` Files []*objects.DiscordFile `json:"-" url:"-"` Embeds []*objects.Embed `json:"embeds,omitempty" url:"-"` AllowedMentions *objects.AllowedMentions `json:"allowed_mentions,omitempty" url:"-"` Components []*objects.Component `json:"components,omitempty" url:"-"` Attachments []*objects.Attachment `json:"attachments,omitempty" url:"-"` Flags objects.MessageFlag `json:"flags,omitempty" url:"-"` }
type GetAuditLogParams ¶
type GetGuildScheduledEventParams ¶ added in v0.1.0
type GetGuildScheduledEventParams struct {
WithUserCount bool `url:"with_user_count,omitempty"`
}
type GetGuildScheduledEventUsersParams ¶ added in v0.1.0
type GetInviteParams ¶
type GetInviteParams struct {
WithCounts bool `url:"with_counts"`
}
type GetReactionsParams ¶
type GuildWidgetImageParams ¶
type GuildWidgetImageParams struct {
Style string
}
type GuildWidgetParams ¶
type HTTPClient ¶
type HTTPClient interface {
Request(req *request) (*DiscordResponse, error)
}
type LeakyBucketRatelimiter ¶ added in v0.0.12
func NewLeakyBucketRatelimiter ¶ added in v0.0.12
func NewLeakyBucketRatelimiter() *LeakyBucketRatelimiter
func (*LeakyBucketRatelimiter) GetBucket ¶ added in v0.0.12
func (c *LeakyBucketRatelimiter) GetBucket(path string) *rate.Limiter
func (*LeakyBucketRatelimiter) Request ¶ added in v0.0.12
func (c *LeakyBucketRatelimiter) Request(httpClient HTTPClient, req *request) (*DiscordResponse, error)
type ListGuildMembersParams ¶
type ListThreadsParams ¶
type ListThreadsResponse ¶
type ListThreadsResponse struct { Threads []*objects.Channel `json:"threads"` Members []*objects.ThreadMember `json:"members"` HasMore bool `json:"has_more"` }
type MemoryCache ¶
Reference in-memory implementation
func NewMemoryCache ¶
func NewMemoryCache() *MemoryCache
func (*MemoryCache) Get ¶
func (m *MemoryCache) Get(key string) (*DiscordResponse, error)
func (*MemoryCache) Put ¶
func (m *MemoryCache) Put(key string, resp *DiscordResponse) error
type MemoryCacheConfig ¶
type MemoryCacheConfig struct {
// contains filtered or unexported fields
}
type MemoryConf ¶
type MemoryConf struct {
MaxRetries int
}
type MemoryRatelimiter ¶
type MemoryRatelimiter struct { sync.Mutex MaxRetries int // contains filtered or unexported fields }
func NewMemoryRatelimiter ¶
func NewMemoryRatelimiter(conf *MemoryConf) *MemoryRatelimiter
func (*MemoryRatelimiter) Request ¶
func (m *MemoryRatelimiter) Request(httpClient HTTPClient, req *request) (*DiscordResponse, error)
type ModifyChannelParams ¶
type ModifyChannelParams struct { Name *string `json:"name,omitempty"` Type *objects.ChannelType `json:"type,omitempty"` Position *int64 `json:"position,omitempty"` Topic *string `json:"topic,omitempty"` NSFW *bool `json:"nsfw,omitempty"` RateLimitPerUser *int64 `json:"rate_limit_per_user,omitempty"` Bitrate *int64 `json:"bitrate,omitempty"` UserLimit *int64 `json:"user_limit,omitempty"` PermissionOverwrites *[]objects.PermissionOverwrite `json:"permission_overwrites,omitempty"` Parent *objects.Snowflake `json:"parent_id,omitempty"` Reason string `json:"-"` }
type ModifyCurrentUserParams ¶
type ModifyGuildMemberParams ¶
type ModifyGuildMemberParams struct { Nick *string `json:"nick,omitempty"` Roles *[]objects.Snowflake `json:"roles,omitempty"` Mute *bool `json:"mute,omitempty"` Deaf *bool `json:"deaf,omitempty"` ChannelID *objects.Snowflake `json:"channel_id,omitempty"` CommunicationDisabledUntil *objects.Time `json:"communication_disabled_until,omitempty"` Reason string `json:"-"` }
type ModifyGuildParams ¶
type ModifyGuildParams struct { Name string `json:"name,omitempty"` Region string `json:"region,omitempty"` VerificationLevel *objects.VerificationLevel `json:"verification_level,omitempty"` DefaultMessageNotifications *objects.MessageNotificationsLevel `json:"default_message_notifications,omitempty"` ExplicitContentFilter *objects.ExplicitContentFilterLevel `json:"explicit_content_filter,omitempty"` AFKChannelID objects.Snowflake `json:"afk_channel_id,omitempty"` AFKTimeout int64 `json:"afk_timeout,omitempty"` Icon string `json:"icon,omitempty"` OwnerID objects.Snowflake `json:"owner_id,omitempty"` Splash string `json:"splash,omitempty"` Banner string `json:"banner,omitempty"` SystemChannelID objects.Snowflake `json:"system_channel_id,omitempty"` RulesChannelID objects.Snowflake `json:"rules_channel_id,omitempty"` PublicUpdatesChannelID objects.Snowflake `json:"public_updates_channel_id,omitempty"` PreferredLocale string `json:"preferred_locale,omitempty"` Reason string `json:"-"` }
type ModifyGuildRoleParams ¶
type ModifyGuildRoleParams struct { Name string `json:"name,omitempty"` Permissions permissions.PermissionBit `json:"permissions,omitempty"` Color int `json:"color,omitempty"` Hoist *bool `json:"hoist,omitempty"` Mentionable *bool `json:"mentionable,omitempty"` Reason string `json:"-"` }
type ModifyGuildScheduledEventParams ¶ added in v0.1.0
type ModifyGuildScheduledEventParams struct { CreateGuildScheduledEventParams Status objects.GuildScheduledEventStatus `json:"status,omitempty"` }
type ModifyWebhookParams ¶
type ProxyClient ¶ added in v0.0.12
type ProxyClient struct {
// contains filtered or unexported fields
}
func NewProxyClient ¶ added in v0.0.12
type RESTClient ¶ added in v0.1.0
type RESTClient interface { AddGuildCommand(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, *objects.ApplicationCommand) (*objects.ApplicationCommand, error) AddGuildMember(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, *AddGuildMemberParams) (*objects.GuildMember, error) AddGuildMemberRole(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, objects.SnowflakeObject, string) error AddPinnedMessage(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) error AddThreadMember(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) error BatchEditApplicationCommandPermissions(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, []*objects.GuildApplicationCommandPermissions) ([]*objects.GuildApplicationCommandPermissions, error) BeginGuildPrune(context.Context, objects.SnowflakeObject, *BeginGuildPruneParams) (int, error) BulkDeleteMessages(context.Context, objects.SnowflakeObject, *DeleteMessagesParams) error BulkOverwriteGlobalCommands(context.Context, objects.SnowflakeObject, []*objects.ApplicationCommand) ([]*objects.ApplicationCommand, error) BulkOverwriteGuildCommands(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, []*objects.ApplicationCommand) ([]*objects.ApplicationCommand, error) CreateBan(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, *CreateGuildBanParams) error CreateChannelInvite(context.Context, objects.SnowflakeObject, *CreateInviteParams) (*objects.Invite, error) CreateCommand(context.Context, objects.SnowflakeObject, *objects.ApplicationCommand) (*objects.ApplicationCommand, error) CreateDM(context.Context, *CreateDMParams) (*objects.Channel, error) CreateFollowupMessage(context.Context, objects.SnowflakeObject, string, *CreateFollowupMessageParams) (*objects.Message, error) CreateGroupDM(context.Context, *CreateGroupDMParams) (*objects.Channel, error) CreateGuild(context.Context, *CreateGuildParams) (*objects.Guild, error) CreateGuildChannel(context.Context, objects.SnowflakeObject, *ChannelCreateParams) (*objects.Channel, error) CreateGuildFromTemplate(context.Context, string, string) (*objects.Guild, error) CreateGuildRole(context.Context, objects.SnowflakeObject, *CreateGuildRoleParams) (*objects.Role, error) CreateGuildScheduledEvent(context.Context, objects.SnowflakeObject, *CreateGuildScheduledEventParams) (*objects.GuildScheduledEvent, error) CreateGuildSticker(context.Context, objects.SnowflakeObject, *CreateGuildStickerParams) (*objects.Sticker, error) CreateGuildTemplate(context.Context, objects.SnowflakeObject, *CreateGuildTemplateParams) (*objects.Template, error) CreateInteractionResponse(context.Context, objects.SnowflakeObject, string, *objects.InteractionResponse) error CreateMessage(context.Context, objects.SnowflakeObject, *CreateMessageParams) (*objects.Message, error) CreateReaction(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, interface{}) error CreateWebhook(context.Context, objects.SnowflakeObject, *CreateWebhookParams) (*objects.Webhook, error) CrossPostMessage(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) (*objects.Message, error) DeleteAllReactions(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) error DeleteChannel(context.Context, objects.SnowflakeObject, string) (*objects.Channel, error) DeleteChannelPermission(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, string) error DeleteCommand(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) error DeleteEmojiReactions(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, interface{}) error DeleteFollowupMessage(context.Context, objects.SnowflakeObject, string, objects.SnowflakeObject) error DeleteGuild(context.Context, objects.SnowflakeObject) error DeleteGuildCommand(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, objects.SnowflakeObject) error DeleteGuildIntegration(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, string) error DeleteGuildRole(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, string) error DeleteGuildScheduledEvent(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) error DeleteGuildSticker(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, ...string) error DeleteGuildTemplate(context.Context, objects.SnowflakeObject, string, string) (*objects.Template, error) DeleteInvite(context.Context, string, string) (*objects.Invite, error) DeleteMessage(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) error DeleteOriginalInteractionResponse(context.Context, objects.SnowflakeObject, string) error DeleteOwnReaction(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, interface{}) error DeletePinnedMessage(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) error DeleteUserReaction(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, objects.SnowflakeObject, interface{}) error DeleteWebhook(context.Context, objects.SnowflakeObject) error DeleteWebhookMessage(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, string) error DeleteWebhookWithToken(context.Context, objects.SnowflakeObject, string) error EditApplicationCommandPermissions(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, objects.SnowflakeObject, []*objects.ApplicationCommandPermissions) (*objects.GuildApplicationCommandPermissions, error) EditChannelPermissions(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, *EditChannelParams) error EditFollowupMessage(context.Context, objects.SnowflakeObject, string, objects.SnowflakeObject, *EditWebhookMessageParams) (*objects.Message, error) EditMessage(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, *EditMessageParams) (*objects.Message, error) EditOriginalInteractionResponse(context.Context, objects.SnowflakeObject, string, *EditWebhookMessageParams) (*objects.Message, error) EditWebhookMessage(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, string, *EditWebhookMessageParams) (*objects.Message, error) ExecuteWebhook(context.Context, objects.SnowflakeObject, string, *ExecuteWebhookParams) (*objects.Message, error) FollowNewsChannel(context.Context, objects.SnowflakeObject) (*objects.FollowedChannel, error) Gateway(context.Context) (*objects.Gateway, error) GatewayBot(context.Context) (*objects.Gateway, error) GetApplicationCommandPermissions(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, objects.SnowflakeObject) (*objects.GuildApplicationCommandPermissions, error) GetAuditLogs(context.Context, objects.SnowflakeObject, *GetAuditLogParams) (*objects.AuditLog, error) GetChannel(context.Context, objects.SnowflakeObject) (*objects.Channel, error) GetChannelInvites(context.Context, objects.SnowflakeObject) ([]*objects.Invite, error) GetChannelMessage(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) (*objects.Message, error) GetChannelMessages(context.Context, objects.SnowflakeObject, *GetChannelMessagesParams) ([]*objects.Message, error) GetChannelWebhooks(context.Context, objects.SnowflakeObject) ([]*objects.Webhook, error) GetCommand(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) (*objects.ApplicationCommand, error) GetCommands(context.Context, objects.SnowflakeObject) ([]*objects.ApplicationCommand, error) GetCurrentUser(context.Context) (*objects.User, error) GetCurrentUserGuildMember(context.Context, objects.SnowflakeObject) (*objects.GuildMember, error) GetCurrentUserGuilds(context.Context, *CurrentUserGuildsParams) ([]*objects.Guild, error) GetFollowupMessage(context.Context, objects.SnowflakeObject, string, objects.SnowflakeObject) (*objects.Message, error) GetGuild(context.Context, objects.SnowflakeObject) (*objects.Guild, error) GetGuildApplicationCommandPermissions(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) ([]*objects.GuildApplicationCommandPermissions, error) GetGuildBan(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) (*objects.Ban, error) GetGuildBans(context.Context, objects.SnowflakeObject) ([]*objects.Ban, error) GetGuildChannels(context.Context, objects.SnowflakeObject) ([]*objects.Channel, error) GetGuildCommand(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, objects.SnowflakeObject) (*objects.ApplicationCommand, error) GetGuildCommands(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) ([]*objects.ApplicationCommand, error) GetGuildIntegrations(context.Context, objects.SnowflakeObject) ([]*objects.Integration, error) GetGuildInvites(context.Context, objects.SnowflakeObject) ([]*objects.Invite, error) GetGuildMember(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) (*objects.GuildMember, error) GetGuildPreview(context.Context, objects.SnowflakeObject) (*objects.GuildPreview, error) GetGuildPruneCount(context.Context, objects.SnowflakeObject, *GetGuildPruneCountParams) (int, error) GetGuildRoles(context.Context, objects.SnowflakeObject) ([]*objects.Role, error) GetGuildScheduledEvent(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, ...*GetGuildScheduledEventParams) (*objects.GuildScheduledEvent, error) GetGuildScheduledEventUsers(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, ...*GetGuildScheduledEventUsersParams) ([]*objects.GuildScheduledEventUser, error) GetGuildSticker(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) (*objects.Sticker, error) GetGuildTemplates(context.Context, objects.SnowflakeObject) ([]*objects.Template, error) GetGuildVanityURL(context.Context, objects.SnowflakeObject) (*objects.Invite, error) GetGuildVoiceRegions(context.Context, objects.SnowflakeObject) ([]*objects.VoiceRegion, error) GetGuildWebhooks(context.Context, objects.SnowflakeObject) ([]*objects.Webhook, error) GetGuildWelcomeScreen(context.Context, objects.SnowflakeObject) (*objects.MembershipScreening, error) GetGuildWidget(context.Context, objects.SnowflakeObject) (*objects.GuildWidgetJSON, error) GetGuildWidgetImage(context.Context, objects.SnowflakeObject, *GuildWidgetImageParams) (image.Image, error) GetGuildWidgetSettings(context.Context, objects.SnowflakeObject) (*objects.GuildWidget, error) GetInvite(context.Context, string, *GetInviteParams) (*objects.Invite, error) GetOriginalInteractionResponse(context.Context, objects.SnowflakeObject, string) (*objects.Message, error) GetPinnedMessages(context.Context, objects.SnowflakeObject) ([]*objects.Message, error) GetReactions(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, interface{}, *GetReactionsParams) ([]*objects.User, error) GetSticker(context.Context, objects.SnowflakeObject) (*objects.Sticker, error) GetTemplate(context.Context, string) (*objects.Template, error) GetUser(context.Context, objects.SnowflakeObject) (*objects.User, error) GetUserConnections(context.Context) ([]*objects.Connection, error) GetVoiceRegions(context.Context) ([]*objects.VoiceRegion, error) GetWebhook(context.Context, objects.SnowflakeObject) (*objects.Webhook, error) GetWebhookWithToken(context.Context, objects.SnowflakeObject, string) (*objects.Webhook, error) JoinThread(context.Context, objects.SnowflakeObject) error LeaveGuild(context.Context, objects.SnowflakeObject) error LeaveThread(context.Context, objects.SnowflakeObject) error ListActiveThreads(context.Context, objects.SnowflakeObject) ([]*ListThreadsResponse, error) ListGuildMembers(context.Context, objects.SnowflakeObject, *ListGuildMembersParams) ([]*objects.GuildMember, error) ListGuildStickers(context.Context, objects.SnowflakeObject) ([]*objects.Sticker, error) ListJoinedPrivateArchivedThreads(context.Context, objects.SnowflakeObject, ...*ListThreadsParams) (*ListThreadsResponse, error) ListNitroStickerPacks(context.Context) ([]*objects.StickerPack, error) ListPrivateArchivedThreads(context.Context, objects.SnowflakeObject, ...*ListThreadsParams) (*ListThreadsResponse, error) ListPublicArchivedThreads(context.Context, objects.SnowflakeObject, ...*ListThreadsParams) (*ListThreadsResponse, error) ListThreadMembers(context.Context, objects.SnowflakeObject) ([]*objects.ThreadMember, error) ModifyChannel(context.Context, objects.SnowflakeObject, *ModifyChannelParams) (*objects.Channel, error) ModifyCurrentUser(context.Context, *ModifyCurrentUserParams) (*objects.User, error) ModifyCurrentUserNick(context.Context, objects.SnowflakeObject, *ModifyCurrentUserNickParams) (*ModifyCurrentUserNickParams, error) ModifyGuild(context.Context, objects.SnowflakeObject, *ModifyGuildParams) (*objects.Guild, error) ModifyGuildChannelPositions(context.Context, objects.SnowflakeObject, []*ModifyChannelPositionParams, string) error ModifyGuildMember(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, *ModifyGuildMemberParams) (*objects.GuildMember, error) ModifyGuildRole(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, *ModifyGuildRoleParams) (*objects.Role, error) ModifyGuildRolePositions(context.Context, objects.SnowflakeObject, []*ModifyGuildRolePositionsParams) ([]*objects.Role, error) ModifyGuildScheduledEvent(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, *ModifyGuildScheduledEventParams) (*objects.GuildScheduledEvent, error) ModifyGuildSticker(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, *BaseStickerParams) (*objects.Sticker, error) ModifyGuildTemplate(context.Context, objects.SnowflakeObject, string, *ModifyGuildTemplateParams) (*objects.Template, error) ModifyGuildWelcomeScreen(context.Context, objects.SnowflakeObject, *ModifyGuildMembershipScreeningParams) (*objects.MembershipScreening, error) ModifyGuildWidget(context.Context, objects.SnowflakeObject, *GuildWidgetParams) (*objects.GuildWidget, error) ModifyWebhook(context.Context, objects.SnowflakeObject, *ModifyWebhookParams) (*objects.Webhook, error) ModifyWebhookWithToken(context.Context, objects.SnowflakeObject, string, *ModifyWebhookWithTokenParams) (*objects.Webhook, error) RemoveGuildBan(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, string) error RemoveGuildMember(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, string) error RemoveGuildMemberRole(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, objects.SnowflakeObject, string) error RemoveThreadMember(context.Context, objects.SnowflakeObject, objects.SnowflakeObject) error StartThread(context.Context, objects.SnowflakeObject, *StartThreadParams) (*objects.Channel, error) StartThreadWithMessage(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, *StartThreadParams) (*objects.Channel, error) StartTyping(context.Context, objects.SnowflakeObject) error SyncGuildTemplate(context.Context, objects.SnowflakeObject, string) (*objects.Template, error) UpdateCommand(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, *objects.ApplicationCommand) (*objects.ApplicationCommand, error) UpdateGuildCommand(context.Context, objects.SnowflakeObject, objects.SnowflakeObject, objects.SnowflakeObject, *objects.ApplicationCommand) (*objects.ApplicationCommand, error) }
RESTClient is the interface that contains all functions in *rest.Client.
type Ratelimiter ¶
type Ratelimiter interface {
Request(httpClient HTTPClient, req *request) (*DiscordResponse, error)
}
type RedisRatelimiter ¶
type RedisRatelimiter struct { MaxRetries int // contains filtered or unexported fields }
func NewRedisRatelimiter ¶
func NewRedisRatelimiter(conf *RedisConf) (*RedisRatelimiter, error)
func (*RedisRatelimiter) Request ¶
func (r *RedisRatelimiter) Request(httpClient HTTPClient, req *request) (*DiscordResponse, error)
type StartThreadParams ¶
type TestHTTPClient ¶
type TestHTTPClient struct { T *testing.T ExpectedRequest *request Response *DiscordResponse Error error }
TestHTTPClient is a replacement HTTP client that can be used during testing.
func (*TestHTTPClient) Request ¶
func (c *TestHTTPClient) Request(req *request) (*DiscordResponse, error)
Source Files ¶
- audit_log.go
- cache.go
- channel.go
- client.go
- commands.go
- constants.go
- gateway.go
- generate_interface.go
- guild.go
- guild_scheduled_event.go
- http_client.go
- interactions.go
- interface_gen.go
- invite.go
- proxy.go
- ratelimit.go
- ratelimit_leakybucket.go
- ratelimit_memory.go
- ratelimit_redis.go
- response.go
- stickers.go
- template.go
- user.go
- voice.go
- webhook.go
Click to show internal directories.
Click to hide internal directories.