Versions in this module Expand all Collapse all v0 v0.21.0 May 22, 2021 v0.20.0 May 21, 2021 Changes in this version + const GatewayIntentUnprivileged + const GuildFeatureAnimatedIcon + const GuildFeatureBanner + const GuildFeatureCommerce + const GuildFeatureCommunity + const GuildFeatureDiscoverable + const GuildFeatureFeaturable + const GuildFeatureInviteSplash + const GuildFeatureNews + const GuildFeaturePartenered + const GuildFeatureVIPRegions + const GuildFeatureVanityURL + const GuildFeatureVerified + const GuildFeatureWelcomeScreenEnabled + const PermissionAddReactions + const PermissionAdministrator + const PermissionAttachFiles + const PermissionBanMembers + const PermissionChangeNickname + const PermissionConnect + const PermissionCreateInvite + const PermissionDeafenMembers + const PermissionEmbedLinks + const PermissionKickMembers + const PermissionManageChannels + const PermissionManageEmojis + const PermissionManageGuild + const PermissionManageMessages + const PermissionManageNicknames + const PermissionManageRoles + const PermissionManageWebhooks + const PermissionMentionEveryone + const PermissionMoveMembers + const PermissionMuteMembers + const PermissionNone + const PermissionPrioritySpeaker + const PermissionReadMessageHistory + const PermissionSendMessages + const PermissionSendTTSMessages + const PermissionSpeak + const PermissionUseExternalEmojis + const PermissionUseVAD + const PermissionViewAuditLog + const PermissionViewChannel + var ErrAlreadyConnectedToVoice = errors.New(...) + var ErrGatewayAlreadyConnected = errors.New("already connected to the Gateway") + var ErrGatewayNotConnected = errors.New("gateway is not connected") + var ErrInvalidMessageSend = errors.New("no content, embed nor file provided") + var ErrNotConnectedToVoice = errors.New(...) + var ErrNotCurrentUser = errors.New("endpoint only available for current user (@me)") + func CreationTimeOf(id string) (time.Time, error) + func NewAPIError(resp *http.Response) error + func PermissionsContains(permissions, permission int) bool + type APIError struct + Code int + HTTPCode int + Message string + Misc []string + func (e APIError) Error() string + type Activity struct + ApplicationID string + Assets ActivityAssets + CreatedAt int + Details string + Emoji ActivityEmoji + Flags ActivityFlag + Instance bool + Name string + Party ActivityParty + Secrets ActivitySecrets + State string + Timestamps ActivityTimestamp + Type ActivityType + URL string + type ActivityAssets struct + LargeImage string + LargeText string + SmallImage string + SmallText string + type ActivityEmoji struct + Animated bool + ID string + Name string + type ActivityFlag int + const ActivityFlagInstance + const ActivityFlagJoin + const ActivityFlagJoinRequest + const ActivityFlagPlay + const ActivityFlagSpectate + const ActivityFlagSync + type ActivityParty struct + ID string + Size []int + type ActivitySecrets struct + Join string + Match string + Spectate string + type ActivityTimestamp struct + End int64 + Start int64 + type ActivityType int + const ActivityTypeCompeting + const ActivityTypeCustom + const ActivityTypeListening + const ActivityTypePlaying + const ActivityTypeStreaming + type Application struct + BotPublic bool + BotRequireCodeGrant bool + CoverImage string + Description string + Flag int + GuildID string + ID string + Icon string + Name string + Owner *User + PrimarySKUID string + RPCOrigins []string + Slug string + Summary string + Team Team + VerifyKey string + type ApplicationCommand struct + ApplicationID string + DefaultPermissions bool + Description string + ID string + Name string + type ApplicationCommandOption struct + Choices []*ApplicationCommandOptionChoice + Description string + Name string + Options []*ApplicationCommandOption + Required bool + Type ApplicationCommandOptionType + type ApplicationCommandOptionChoice struct + Name string + Value interface{} + type ApplicationCommandOptionType int + const OptionTypeBoolean + const OptionTypeChannel + const OptionTypeInteger + const OptionTypeMentionable + const OptionTypeRole + const OptionTypeString + const OptionTypeSubCommand + const OptionTypeSubCommandGroup + const OptionTypeUser + type ApplicationCommandPermissionType int + const PermissionTypeRole + const PermissionTypeUser + type ApplicationCommandPermissions struct + ID string + Permission bool + Type ApplicationCommandPermissionType + type Ban struct + Reason string + User *User + type BotStatus struct + AFK bool + Activities []BotStatusActivity + Since int + Status Status + type BotStatusActivity struct + Name string + Type ActivityType + URL string + type Channel struct + ApplicationID string + Bitrate int + GuildID string + ID string + Icon string + LastMessageID string + LastPinTimestamp Time + NSFW bool + Name string + OwnerID string + ParentID string + PermissionOverwrites []PermissionOverwrite + Position int + RateLimitPerUser ChannelUserRateLimit + Recipients []User + Topic string + Type ChannelType + UserLimit int + func (c *Channel) Clone() *Channel + type ChannelMention struct + GuildID string + ID string + Name string + Type ChannelType + type ChannelSetting func(*ChannelSettings) + func WithChannelBitrate(bitrate int) ChannelSetting + func WithChannelNSFW(yes bool) ChannelSetting + func WithChannelName(name string) ChannelSetting + func WithChannelParent(id string) ChannelSetting + func WithChannelPermissions(perms []PermissionOverwrite) ChannelSetting + func WithChannelPosition(pos int) ChannelSetting + func WithChannelRateLimitPerUser(rateLimit ChannelUserRateLimit) ChannelSetting + func WithChannelTopic(topic string) ChannelSetting + func WithChannelType(t ChannelType) ChannelSetting + func WithChannelUserLimit(limit int) ChannelSetting + type ChannelSettings struct + Bitrate *optional.Int + NSFW *optional.Bool + Name *optional.String + ParentID *optional.String + Permissions []PermissionOverwrite + Position *optional.Int + RateLimitPerUser *optional.Int + Topic *optional.String + Type *optional.Int + UserLimit *optional.Int + func NewChannelSettings(opts ...ChannelSetting) *ChannelSettings + type ChannelType int + const ChannelTypeDM + const ChannelTypeGroupDM + const ChannelTypeGuildCategory + const ChannelTypeGuildNews + const ChannelTypeGuildStore + const ChannelTypeGuildText + const ChannelTypeGuildVoice + type ChannelUserRateLimit int + const ChannelUserRateLimit10m + const ChannelUserRateLimit10s + const ChannelUserRateLimit15m + const ChannelUserRateLimit15s + const ChannelUserRateLimit1h + const ChannelUserRateLimit1m + const ChannelUserRateLimit2h + const ChannelUserRateLimit2m + const ChannelUserRateLimit30m + const ChannelUserRateLimit30s + const ChannelUserRateLimit5m + const ChannelUserRateLimit5s + const ChannelUserRateLimit6h + type ClientStatus struct + Desktop string + Mobile string + Web string + type Emoji struct + Animated bool + Available bool + ID string + Managed bool + Name string + RequireColons bool + Roles []string + User *User + func (e *Emoji) Clone() *Emoji + type File struct + Name string + Reader io.ReadCloser + func FileFromDisk(filepath, name string) (*File, error) + func FileFromReadCloser(r io.ReadCloser, name string) *File + func FileFromURL(url, name string) (*File, error) + type GatewayIntent int + const GatewayIntentDirectMessageReactions + const GatewayIntentDirectMessageTyping + const GatewayIntentDirectMessages + const GatewayIntentGuild + const GatewayIntentGuildBans + const GatewayIntentGuildEmojis + const GatewayIntentGuildIntegrations + const GatewayIntentGuildInvites + const GatewayIntentGuildMembers + const GatewayIntentGuildMessageReactions + const GatewayIntentGuildMessageTyping + const GatewayIntentGuildMessages + const GatewayIntentGuildPresences + const GatewayIntentGuildVoiceStates + const GatewayIntentGuildWebhooks + func (i GatewayIntent) String() string + type Guild struct + AFKChannelID string + AFKTimeout GuildAFKTimeout + ApplicationID string + Banner string + Channels []Channel + DefaultMessageNotifications GuildDefaultNotificationLevel + Description string + DiscoverySplash string + Emojis []Emoji + ExplicitContentFilter GuildExplicitContentFilter + Features []string + ID string + Icon string + JoinedAt Time + Large bool + MFALevel MFALevel + MaxMembers int + MaxVideoChannelUsers int + MemberCount int + Members []GuildMember + Name string + Owner bool + OwnerID string + Permissions int + PreferredLocale string + PremiumSubscriptionCount int + PremiumTier PremiumTier + Presences []Presence + PublicUpdatesChannelID string + Region string + Roles []Role + RulesChannelID string + Splash string + SystemChannelFlags SystemChannelFlag + SystemChannelID string + Unavailable bool + VanityURLCode string + VerificationLevel GuildVerificationLevel + VoiceStates []voice.State + WidgetChannelID string + WidgetEnabled bool + func (g *Guild) Clone() *Guild + type GuildAFKTimeout int + const GuildAFKTimeout15m + const GuildAFKTimeout1h + const GuildAFKTimeout1m + const GuildAFKTimeout30m + const GuildAFKTimeout5m + type GuildApplicationCommandPermissions struct + ApplicationID string + GuildID string + ID string + Permissions []*ApplicationCommandPermissions + type GuildDefaultNotificationLevel int + const GuildDefaultNotificationLevelAll + const GuildDefaultNotificationLevelMentionOnly + type GuildExplicitContentFilter int + const GuildExplicitContentFilterAll + const GuildExplicitContentFilterDisabled + const GuildExplicitContentFilterWithoutRole + type GuildFeature string + type GuildIntegration struct + Account GuildIntegrationAccount + Application GuildIntegrationApplication + EnableEmoticons bool + Enabled bool + ExpireBehavior int + ExpireGracePeriod int + ID string + Name string + Revoked bool + RoleID string + SubscriberCount int + SyncedAt Time + Syncing bool + Type string + User User + type GuildIntegrationAccount struct + ID string + Name string + type GuildIntegrationApplication struct + Bot User + Description string + ID string + Icon string + Name string + Summary string + type GuildIntegrationSetting func(*GuildIntegrationSettings) + func WithGuildIntegrationEnableEmoticons(yes bool) GuildIntegrationSetting + func WithGuildIntegrationExpireBehavior(v int) GuildIntegrationSetting + func WithGuildIntegrationExpireGracePeriod(v int) GuildIntegrationSetting + type GuildIntegrationSettings struct + EnableEmoticons *optional.Bool + ExpireBehavior *optional.Int + ExpireGracePeriod *optional.Int + func NewGuildIntegrationSettings(opts ...GuildIntegrationSetting) *GuildIntegrationSettings + type GuildMember struct + Deaf bool + JoinedAt Time + Mute bool + Nick string + PremiumSince Time + Roles []string + User *User + func (m *GuildMember) Clone() *GuildMember + func (m *GuildMember) HasRole(id string) bool + func (m *GuildMember) PermissionsIn(g *Guild, ch *Channel) (permissions int) + type GuildMemberSetting func(*GuildMemberSettings) + func WithGuildMemberChannelID(id string) GuildMemberSetting + func WithGuildMemberDeaf(yes bool) GuildMemberSetting + func WithGuildMemberMute(yes bool) GuildMemberSetting + func WithGuildMemberNick(name string) GuildMemberSetting + func WithGuildMemberRoles(roleIDs []string) GuildMemberSetting + type GuildMemberSettings struct + ChannelID *optional.String + Deaf *optional.Bool + Mute *optional.Bool + Nick *optional.String + Roles *optional.StringSlice + func NewGuildMemberSettings(opts ...GuildMemberSetting) *GuildMemberSettings + type GuildSetting func(*GuildSettings) + func WithGuildAFKChannel(id string) GuildSetting + func WithGuildAFKTimeout(t GuildAFKTimeout) GuildSetting + func WithGuildDefaultMessageNotifications(lvl GuildDefaultNotificationLevel) GuildSetting + func WithGuildExplicitContentFilter(lvl GuildExplicitContentFilter) GuildSetting + func WithGuildIcon(icon string) GuildSetting + func WithGuildName(name string) GuildSetting + func WithGuildOwner(id string) GuildSetting + func WithGuildRegion(region string) GuildSetting + func WithGuildSplash(splash string) GuildSetting + func WithGuildSystemChannel(id string) GuildSetting + func WithGuildVerificationLevel(lvl GuildVerificationLevel) GuildSetting + type GuildSettings struct + AFKChannelID *optional.String + AFKTimeout *optional.Int + DefaultMessageNotifications *optional.Int + ExplicitContentFilter *optional.Int + Icon *optional.String + Name *optional.String + OwnerID *optional.String + Region *optional.String + Splash *optional.String + SystemChannelID *optional.String + VerificationLevel *optional.Int + func NewGuildSettings(opts ...GuildSetting) *GuildSettings + type GuildVerificationLevel int + const GuildVerificationLevelHigh + const GuildVerificationLevelLow + const GuildVerificationLevelMedium + const GuildVerificationLevelNone + const GuildVerificationLevelVeryHigh + type GuildWidget struct + ChannelID string + Enabled bool + type Interaction struct + ApplicationID string + ChannelID string + Data *InteractionData + GuildID string + ID string + Member *GuildMember + Token string + User *User + Version int + type InteractionData struct + ID string + Name string + Options *InteractionDataOption + Resolved *InteractionDataResolved + type InteractionDataOption struct + Name string + Options []*InteractionDataOption + Type ApplicationCommandOptionType + Value interface{} + func (o *InteractionDataOption) Boolean() bool + func (o *InteractionDataOption) Channel() string + func (o *InteractionDataOption) Int64() int64 + func (o *InteractionDataOption) Mentionable() string + func (o *InteractionDataOption) Role() string + func (o *InteractionDataOption) String() string + func (o *InteractionDataOption) User() string + type InteractionDataResolved struct + Channels map[string]*Channel + Members map[string]*GuildMember + Roles map[string]*Role + Users map[string]*User + type InteractionType int + const InteractionTypeApplicationCommand + const InteractionTypePing + type Invite struct + ApproximateMemberCount int + ApproximatePresenceCount int + Channel Channel + Code string + Guild Guild + type InviteMetadata struct + CreatedAt Time + Inviter User + MaxAge int + MaxUses int + Revoked bool + Temporary bool + Uses int + type InviteSetting func(*InviteSettings) + func WithInviteMaxAge(age time.Duration) InviteSetting + func WithInviteMaxUses(uses int) InviteSetting + func WithInviteTemporary(yes bool) InviteSetting + func WithInviteUnique(yes bool) InviteSetting + type InviteSettings struct + MaxAge *optional.Int + MaxUses *optional.Int + Temporary *optional.Bool + Unique *optional.Bool + func NewInviteSettings(opts ...InviteSetting) *InviteSettings + type MFALevel int + const MFALevelElevated + const MFALevelNone + type Message struct + Activity MessageActivity + Application MessageApplication + Attachments []MessageAttachment + Author User + ChannelID string + Content string + EditedTimestamp Time + Embeds []MessageEmbed + Flags MessageFlag + GuildID string + ID string + Member GuildMember + MentionChannels []ChannelMention + MentionEveryone bool + MentionRoles []string + Mentions []User + MessageReference MessageReference + Nonce string + Pinned bool + Reactions []MessageReaction + ReferencedMessage *Message + Stickers []MessageSticker + TTS bool + Timestamp Time + Type MessageType + WebhookID string + type MessageActivity struct + PartyID string + Type MessageActivityType + type MessageActivityType int + const MessageActivityTypeJoin + const MessageActivityTypeJoinRequest + const MessageActivityTypeListen + const MessageActivityTypeSpectate + type MessageApplication struct + CoverImage string + Description string + ID string + Icon string + Name string + type MessageAttachment struct + Filename string + Height int + ID string + ProxyURL string + Size int + URL string + Width int + type MessageEmbed struct + Author *MessageEmbedAuthor + Color int + Description string + Fields []MessageEmbedField + Footer *MessageEmbedFooter + Image *MessageEmbedImage + Provider *MessageEmbedProvider + Thumbnail *MessageEmbedThumbnail + Timestamp Time + Title string + Type MessageEmbedType + URL string + Video *MessageEmbedVideo + type MessageEmbedAuthor struct + IconURL string + Name string + ProxyIconURL string + URL string + type MessageEmbedField struct + Inline bool + Name string + Value string + type MessageEmbedFooter struct + IconURL string + ProxyIconURL string + Text string + type MessageEmbedImage struct + Height int + ProxyURL string + URL string + Width int + type MessageEmbedProvider struct + Name string + URL string + type MessageEmbedThumbnail struct + Height int + ProxyURL string + URL string + Width int + type MessageEmbedType string + const MessageEmbedTypeArticle + const MessageEmbedTypeGIFV + const MessageEmbedTypeImage + const MessageEmbedTypeLink + const MessageEmbedTypeRich + const MessageEmbedTypeVideo + type MessageEmbedVideo struct + Height int + URL string + Width int + type MessageFlag int + const MessageFlagCrossposted + const MessageFlagIsCrosspost + const MessageFlagSuppressEmbeds + type MessageReaction struct + Count int + Emoji Emoji + Me bool + type MessageReference struct + ChannelID string + GuildID string + MessageID string + type MessageSticker struct + Asset string + Description string + FormatType StickerFormat + ID string + Name string + PackID string + PreviewAsset string + Tags string + type MessageType int + const MessageTypeCall + const MessageTypeChannelFollowAdd + const MessageTypeChannelIconChange + const MessageTypeChannelNameChange + const MessageTypeChannelPinnedMessage + const MessageTypeCommand + const MessageTypeDefault + const MessageTypeGuildDiscoveryDisqualified + const MessageTypeGuildDiscoveryRequalified + const MessageTypeGuildMemberJoin + const MessageTypeRecipientAdd + const MessageTypeRecipientRemove + const MessageTypeReply + const MessageTypeUserPremiumGuildSubscription + const MessageTypeUserPremiumGuildSubscriptionTier1 + const MessageTypeUserPremiumGuildSubscriptionTier2 + const MessageTypeUserPremiumGuildSubscriptionTier3 + type PartialApplication struct + Flags int + ID string + type PartialGuild struct + ID string + Icon string + Name string + Owner bool + Permissions int + type PermissionOverwrite struct + Allow int + Deny int + ID string + Type int + func (o *PermissionOverwrite) Clone() *PermissionOverwrite + type PremiumTier int + const PremiumTier1 + const PremiumTier2 + const PremiumTier3 + const PremiumTierNone + type PremiumType int + const PremiumTypeNitro + const PremiumTypeNitroClassic + const PremiumTypeNone + type Presence struct + Activities []Activity + ClientStatus ClientStatus + GuildID string + Status Status + User *User + func (p *Presence) Clone() *Presence + type Role struct + Color int + Hoist bool + ID string + Managed bool + Mentionable bool + Name string + Permissions int + Position int + func (r *Role) Clone() *Role + type RoleSetting func(*RoleSettings) + func WithRoleColor(hexCode int) RoleSetting + func WithRoleHoist(yes bool) RoleSetting + func WithRoleMentionable(yes bool) RoleSetting + func WithRoleName(name string) RoleSetting + func WithRolePermissions(perm int) RoleSetting + type RoleSettings struct + Color *optional.Int + Hoist *optional.Bool + Mentionable *optional.Bool + Name *optional.String + Permissions *optional.String + func NewRoleSettings(opts ...RoleSetting) *RoleSettings + type Status string + const StatusDND + const StatusIdle + const StatusInvisible + const StatusOffline + const StatusOnline + type StickerFormat int + const StickerFormatAPNG + const StickerFormatLOTTIE + const StickerFormatPNG + type SystemChannelFlag int + const SystemChannelFlagSupressJoinNotifications + const SystemChannelFlagSupressPremiumSubscriptions + type Team struct + ID string + Icon string + Members []TeamMember + OwnerUserID string + type TeamMember struct + MembershipState int + Permissions []string + TeamID string + User User + type Time struct + func TimeFromStd(t time.Time) Time + func (t *Time) UnmarshalJSON(data []byte) error + func (t Time) MarshalJSON() ([]byte, error) + func (t Time) Std() time.Time + type UnavailableGuild struct + ID string + Unavailable *bool + func (g *UnavailableGuild) Clone() *UnavailableGuild + type User struct + Avatar string + Bot bool + Discriminator string + Email string + Flags UserFlag + ID string + Locale string + MFAEnabled bool + PremiumType PremiumType + PublicFlags UserFlag + System bool + Username string + Verified bool + func (u *User) AvatarURL() string + func (u *User) Clone() *User + type UserConnection struct + FriendSync bool + ID string + Integrations []GuildIntegration + Name string + Revoked bool + ShowActivity bool + Type string + Verified bool + Visibility Visibility + type UserFlag int + const UserFlagBugHunterLevel1 + const UserFlagBugHunterLevel2 + const UserFlagDiscordEmployee + const UserFlagEarlySupporter + const UserFlagEarlyVerifiedBotDeveloper + const UserFlagHouseBalance + const UserFlagHouseBravery + const UserFlagHouseBrilliance + const UserFlagHypeSquadEvents + const UserFlagNone + const UserFlagPartneredServerOwner + const UserFlagSystem + const UserFlagTeamUser + const UserFlagVerifiedBot + type ValidationError struct + Errors map[string]json.RawMessage + HTTPCode int + func (e ValidationError) Error() string + type Visibility int + const VisibilityEveryone + const VisibilityNone + type VoiceRegion struct + Custom bool + Deprecated bool + ID string + Name string + Optimal bool + VIP bool + type Webhook struct + Avatar string + ChannelID string + GuildID string + ID string + Name string + Token string + User *User + type WebhookParameter func(*WebhookParameters) + func WithWebhookAvatarURL(content string) WebhookParameter + func WithWebhookContent(content string) WebhookParameter + func WithWebhookEmbeds(embeds []MessageEmbed) WebhookParameter + func WithWebhookFiles(files []File) WebhookParameter + func WithWebhookTTS(yes bool) WebhookParameter + func WithWebhookUsername(content string) WebhookParameter + type WebhookParameters struct + AvatarURL *optional.String + Content *optional.String + Embeds []MessageEmbed + Files []File + TTS *optional.Bool + Username *optional.String + func NewWebhookParameters(opts ...WebhookParameter) *WebhookParameters + func (p *WebhookParameters) Bytes() ([]byte, error) + type WebhookSetting func(*WebhookSettings) + func WithWebhookAvatar(name string) WebhookSetting + func WithWebhookChannel(id string) WebhookSetting + func WithWebhookName(name string) WebhookSetting + type WebhookSettings struct + Avatar *optional.String + ChannelID *optional.String + Name *optional.String + func NewWebhookSettings(opts ...WebhookSetting) *WebhookSettings