Documentation ¶
Overview ¶
Package discord contains all types (structs, enums) used by discord
Index ¶
- Constants
- func BasePermissions(member Member, guild Guild) (perm permissions.Permission)
- func ChannelPermissions(guild Guild, member Member, overwrites []permissions.Overwrite) (perm permissions.Permission)
- type Activity
- type ActivityAssets
- type ActivityButton
- type ActivityFlags
- type ActivityParty
- type ActivityTimestamps
- type ActivityType
- type Attachment
- type BaseMessage
- func (v BaseMessage) API(client ClientQuery) MessageQuery
- func (v BaseMessage) Author(client ClientQuery) UserQuery
- func (v BaseMessage) Channel(client ClientQuery) ChannelQuery
- func (v BaseMessage) Edit(client ClientQuery) MessageBuilder
- func (v BaseMessage) Fetch(api ClientQuery) error
- func (v BaseMessage) Guild(client ClientQuery) GuildQuery
- func (v BaseMessage) IsGuild() bool
- func (v BaseMessage) Member(client ClientQuery) GuildMemberQuery
- func (v BaseMessage) Reply(client ClientQuery, ref bool) CreateMessageBuilder
- type BaseMessageBuilder
- type BasePresence
- type BuilderExecutor
- type BuilderExecutorReason
- type Channel
- func (v Channel) Edit(api ClientQuery) UpdateChannelTypeSelector
- func (v Channel) Guild(api ClientQuery) GuildQuery
- func (v Channel) IsForum() bool
- func (v Channel) IsStage() bool
- func (v Channel) IsThread() bool
- func (v Channel) MemberPermissions(api ClientQuery, member snowflake.ID) (perm permissions.Permission, err error)
- func (v Channel) Mention() string
- func (v Channel) Parent(api ClientQuery) ChannelQuery
- func (v Channel) Thread() bool
- type ChannelFlag
- type ChannelMessagesQuery
- type ChannelQuery
- type ChannelType
- type ChannelUpdate
- type ChannelWithMessage
- type ClientQuery
- type CreateForumMessageBuilder
- type CreateMessageBuilder
- type CreateThreadChannelBuilder
- type CreateThreadTypeSelector
- type EmbedAuthor
- type EmbedField
- type EmbedFooter
- type EmbedMedia
- type EmbedProvider
- type EmbedType
- type Emoji
- type ExpandableCreateThreadChannelBuilder
- type ExpandableGuildChannelBuilder
- type ExpandableUpdateGuildChannelBuilder
- type ExpandableUpdateThreadChannelBuilder
- type ExpandableWebhookExecuteBuilder
- type ExpandableWebhookUpdateMessageBuilder
- type ForumMessageCreate
- type ForumSortOrder
- type ForumTag
- type Guild
- type GuildBuilder
- type GuildChannelBuilder
- type GuildChannelPositions
- type GuildChannelPositionsBuilder
- type GuildDefaultNotifications
- type GuildExplicitContentFilter
- type GuildMemberQuery
- type GuildNSFWLevel
- type GuildPremiumTier
- type GuildQuery
- type GuildScheduledEvent
- type GuildSticker
- type GuildUpdate
- type GuildVerificationLevel
- type GuildWithData
- type Integration
- type IntegrationExpireBehavior
- type Invite
- type InviteQuery
- type InviteTargetType
- type InviteWithMeta
- type LowLevelClientQuery
- type Member
- func (x Member) API(client ClientQuery) GuildMemberQuery
- func (x Member) Ban(client ClientQuery, days uint8) error
- func (x Member) Guild(client ClientQuery) GuildQuery
- func (x Member) Kick(client ClientQuery) error
- func (x Member) Mention() string
- func (x Member) Permissions(bot ClientQuery) (perm permissions.Permission, err error)
- func (x Member) PermissionsIn(bot ClientQuery, channel snowflake.ID) (resperm permissions.Permission, err error)
- func (x Member) User(client ClientQuery) UserQuery
- type MemberUpdate
- type MemberWithUser
- type Message
- type MessageActivity
- type MessageActivityType
- type MessageAllowedMentions
- type MessageBuilder
- type MessageChannelMention
- type MessageCreate
- type MessageEmbed
- type MessageFile
- type MessageInteraction
- type MessageQuery
- type MessageReaction
- func (v MessageReaction) API(api ClientQuery) MessageReactionQuery
- func (v MessageReaction) Channel(api ClientQuery) ChannelQuery
- func (v MessageReaction) Message(api ClientQuery) MessageQuery
- func (v MessageReaction) Remove(api ClientQuery, userID snowflake.ID) error
- func (v MessageReaction) RemoveOwn(api ClientQuery) error
- func (v MessageReaction) Users(api ClientQuery, limit uint64) ([]User, error)
- type MessageReactionQuery
- type MessageReference
- type MessageType
- type Presence
- type PresenceClientStatus
- type PresenceStatus
- type QueryOptions
- type ReactionStore
- type Role
- type RoleBuilder
- type RoleCreate
- type RolePositions
- type RoleQuery
- type RoleSlice
- type RoleTags
- type ScheduledEventMeta
- type ScheduledEventStatus
- type ScheduledEventType
- type Slice
- type StageInstance
- type StageQuery
- type SystemChannelFlag
- type ThreadArchiveDuration
- type ThreadCreate
- type ThreadMember
- type ThreadMetadata
- type UpdateChannelTypeSelector
- type UpdateGuildChannelBuilder
- type UpdateGuildMemberBuilder
- type UpdateThreadChannelBuilder
- type User
- type UserFlag
- type UserPremiumType
- type UserQuery
- type VoiceState
- type Webhook
- type WebhookCreate
- type WebhookExecute
- type WebhookExecuteBuilder
- type WebhookQuery
- type WebhookType
- type WebhookUpdateMessageBuilder
Constants ¶
const ( ActivityGame = iota ActivityStreaming ActivityListening ActivityWatching ActivityCustom ActivityCompeting )
const ( StatusOnline = "online" StatusIdle = "idle" StatusDND = "dnd" StatusOffline = "offline" )
Variables ¶
This section is empty.
Functions ¶
func BasePermissions ¶
func BasePermissions(member Member, guild Guild) (perm permissions.Permission)
func ChannelPermissions ¶
func ChannelPermissions(guild Guild, member Member, overwrites []permissions.Overwrite) (perm permissions.Permission)
Types ¶
type Activity ¶
type Activity struct { Emoji *Emoji `json:"emoji,omitempty"` Party *ActivityParty `json:"party,omitempty"` Assets *ActivityAssets `json:"assets,omitempty"` Name string `json:"name"` Details string `json:"details,omitempty"` State string `json:"state,omitempty"` Url string `json:"url,omitempty"` ApplicationID snowflake.ID `json:"application_id,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` Flags ActivityFlags `json:"flags,omitempty"` Type ActivityType `json:"type"` Instance bool `json:"instance,omitempty"` }
Activity
Reference: https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
type ActivityAssets ¶
type ActivityButton ¶
type ActivityFlags ¶
type ActivityFlags uint16
const ( ActivityFlagInstance ActivityFlags = 1 << iota ActivityFlagJoin ActivityFlagSpectate ActivityFlagJoinRequest ActivityFlagSync ActivityFlagPlay ActivityFlagPartyFriends ActivityFlagPartyVoice ActivityFlagEmbedded )
type ActivityParty ¶
type ActivityTimestamps ¶
type ActivityType ¶
type ActivityType uint8
type Attachment ¶
type Attachment struct { ProxyUrl string `json:"proxy_url,omitempty"` Filename string `json:"filename,omitempty"` Description string `json:"description,omitempty"` ContentType string `json:"content_type,omitempty"` Url string `json:"url,omitempty"` Size int `json:"size,omitempty"` ID snowflake.ID `json:"id"` Height int `json:"height,omitempty"` Width int `json:"width,omitempty"` Ephemeral bool `json:"ephemeral,omitempty"` }
type BaseMessage ¶
type BaseMessage struct { EditedTimestamp timeconv.Timestamp `json:"edited_timestamp"` Timestamp timeconv.Timestamp `json:"timestamp"` Reference *MessageReference `json:"message_reference"` Activity MessageActivity `json:"activity"` Nonce string `json:"nonce"` Content string `json:"content"` Attachments []Attachment `json:"attachments"` Components []components.Component `json:"components"` Embeds []MessageEmbed `json:"embeds"` Mentions []User `json:"mentions"` MentionRoles []snowflake.ID `json:"mention_roles"` MentionChannels []MessageChannelMention `json:"mention_channels"` Interaction MessageInteraction `json:"interaction"` ApplicationID snowflake.ID `json:"application_id"` GuildID snowflake.ID `json:"guild_id"` ChannelID snowflake.ID `json:"channel_id"` WebhookID snowflake.ID `json:"webhook_id"` AuthorID snowflake.ID `json:"author_id"` ID snowflake.ID `json:"id"` Type MessageType `json:"type"` MentionEveryone bool `json:"mention_everyone"` TTS bool `json:"tts"` Pinned bool `json:"pinned"` }
func (BaseMessage) API ¶
func (v BaseMessage) API(client ClientQuery) MessageQuery
func (BaseMessage) Author ¶
func (v BaseMessage) Author(client ClientQuery) UserQuery
func (BaseMessage) Channel ¶
func (v BaseMessage) Channel(client ClientQuery) ChannelQuery
func (BaseMessage) Edit ¶
func (v BaseMessage) Edit(client ClientQuery) MessageBuilder
func (BaseMessage) Fetch ¶
func (v BaseMessage) Fetch(api ClientQuery) error
func (BaseMessage) Guild ¶
func (v BaseMessage) Guild(client ClientQuery) GuildQuery
func (BaseMessage) IsGuild ¶
func (v BaseMessage) IsGuild() bool
func (BaseMessage) Member ¶
func (v BaseMessage) Member(client ClientQuery) GuildMemberQuery
func (BaseMessage) Reply ¶
func (v BaseMessage) Reply(client ClientQuery, ref bool) CreateMessageBuilder
type BaseMessageBuilder ¶
type BaseMessageBuilder[B any] interface { Content(str string) B Embed(embed MessageEmbed) B Embeds(embeds []MessageEmbed) B // Deprecated: Use ActionRow or AutoActionRows instead. Components(list []components.Component) B // ActionRow appends new row with given components. ActionRow(items ...components.ActionRowItem) B // AutoActionRows will automatically split components into rows. AutoActionRows(items ...components.ActionRowItem) B File(f MessageFile) B Files(f []MessageFile) B KeepFiles(files []Attachment) B AllowedMentions(allowed MessageAllowedMentions) B DoNotKeepFiles() B ClearEmbeds() B ClearFiles() B ClearContent() B ClearComponents() B ClearAllowedMentions() B Raw() MessageCreate Builder() B }
type BasePresence ¶
type BasePresence struct { ClientStatus PresenceClientStatus `json:"client_status"` Status PresenceStatus `json:"status"` Activities []Activity `json:"activities"` GuildID snowflake.ID `json:"guild_id"` UserID snowflake.ID `json:"user_id"` }
type BuilderExecutor ¶
type BuilderExecutor[R any] interface { Execute(api ClientQuery) (*R, error) }
type BuilderExecutorReason ¶
type BuilderExecutorReason[R any] interface { Execute(api ClientQuery, reason ...string) (*R, error) }
type Channel ¶
type Channel struct { LastPinTimestamp timeconv.Timestamp `json:"last_pin_timestamp"` ThreadMetadata *ThreadMetadata `json:"thread_metadata"` Member *ThreadMember `json:"member"` Topic string `json:"topic"` RTCRegion string `json:"rtc_region"` Name string `json:"name"` Icon string `json:"icon"` Recipients []User `json:"recipients"` Overwrites []permissions.Overwrite `json:"permission_overwrites"` ID snowflake.ID `json:"id"` UserLimit int `json:"user_limit"` RateLimitPerUser int `json:"rate_limit_per_user"` Bitrate int `json:"bitrate"` LastMessageID snowflake.ID `json:"last_message_id"` OwnerID snowflake.ID `json:"owner_id"` ApplicationID snowflake.ID `json:"application_id"` ParentID snowflake.ID `json:"parent_id"` Position int `json:"position"` GuildID snowflake.ID `json:"guild_id"` DefaultAutoArchiveDuration timeconv.Seconds `json:"default_auto_archive_duration"` NSFW bool `json:"nsfw"` Flags ChannelFlag `json:"flags"` TotalMessageSent uint32 `json:"total_message_sent"` Tags []snowflake.ID `json:"applied_tags"` AvailableTags []ForumTag `json:"available_tags"` DefaultSortOrder ForumSortOrder `json:"default_sort_order"` Permissions permissions.Permission `json:"permissions"` MessageCount uint32 `json:"message_count"` Type ChannelType `json:"type"` }
Channel
Reference: https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
func (Channel) Edit ¶
func (v Channel) Edit(api ClientQuery) UpdateChannelTypeSelector
func (Channel) Guild ¶
func (v Channel) Guild(api ClientQuery) GuildQuery
func (Channel) MemberPermissions ¶
func (v Channel) MemberPermissions(api ClientQuery, member snowflake.ID) (perm permissions.Permission, err error)
func (Channel) Parent ¶
func (v Channel) Parent(api ClientQuery) ChannelQuery
type ChannelFlag ¶
type ChannelFlag uint8
const ( ChannelFlagPinned ChannelFlag = 1 << 1 ChannelFlagRequireTag ChannelFlag = 1 << 4 )
type ChannelMessagesQuery ¶
type ChannelMessagesQuery interface { Around(id snowflake.ID, limit uint16) (msgs []Message, err error) After(ctx context.Context, id snowflake.ID, limit uint16) (msgs []Message, err error) Before(ctx context.Context, id snowflake.ID, limit uint16) (msgs []Message, err error) Latest(limit uint16) (msgs []Message, err error) ID() snowflake.ID }
type ChannelQuery ¶
type ChannelQuery interface { QueryOptions[ChannelQuery] Message(id snowflake.ID) MessageQuery SendMessage() CreateMessageBuilder Get() (ch *Channel, err error) Edit() UpdateChannelTypeSelector Delete() error Messages() ChannelMessagesQuery Bulk(ids []snowflake.ID) error // EditPermissions // DeletePermission(id snowflake.ID) error Invites() (invites []InviteWithMeta, err error) //CreateInvite() (inv *Invite, err error) Follow(target snowflake.ID) error Pinned() (msg []Message, err error) StartThread(name string) CreateThreadTypeSelector StartForumThread(name string) CreateForumMessageBuilder Join() error AddMember(id snowflake.ID) error Leave() error RemoveMember(id snowflake.ID) error GetThreadMember(id snowflake.ID) (tm *ThreadMember, err error) Stage() StageQuery ID() snowflake.ID Webhooks() ([]Webhook, error) CreateWebhook(create WebhookCreate) (*Webhook, error) }
type ChannelType ¶
type ChannelType uint8
const ( ChannelTypeText ChannelType = iota ChannelTypeDM ChannelTypeVoice ChannelTypeGroup ChannelTypeCategory ChannelTypeNews ChannelTypeStore ChannelTypeNewsThread ChannelType = iota + 3 ChannelTypePublicThread ChannelTypePrivateThread ChannelTypeStage ChannelTypeGuildDirectory ChannelTypeGuildForum )
type ChannelUpdate ¶
type ChannelUpdate struct { Name *string `json:"name,omitempty"` Type *ChannelType `json:"type,omitempty"` Position *int `json:"position,omitempty"` Topic *string `json:"topic,omitempty"` Nsfw *bool `json:"nsfw,omitempty"` RateLimitPerUser *uint32 `json:"rate_limit_per_user,omitempty"` Bitrate *uint64 `json:"bitrate,omitempty"` UserLimit *uint16 `json:"user_limit,omitempty"` ParentID *snowflake.ID `json:"parent_id,omitempty"` DefaultArchiveDuration *ThreadArchiveDuration `json:"default_archive_duration,omitempty"` Overwrites *[]permissions.Overwrite `json:"permission_overwrites,omitempty"` Archived *bool `json:"archived,omitempty"` AutoArchiveDuration *ThreadArchiveDuration `json:"auto_archive_duration,omitempty"` Locked *bool `json:"locked,omitempty"` Invitable *bool `json:"invitable,omitempty"` }
type ChannelWithMessage ¶
type ClientQuery ¶
type ClientQuery interface { // User returns user-specific Discord API methods User(id snowflake.ID) UserQuery // CurrentUser returns current logged user details CurrentUser() (user *User, err error) Channel(id snowflake.ID) ChannelQuery Guild(id snowflake.ID) GuildQuery // Log returns instance of global logger Log() golog.Logger LowLevel() LowLevelClientQuery Webhook(id snowflake.ID, token string) WebhookQuery }
type CreateForumMessageBuilder ¶
type CreateForumMessageBuilder interface { BuilderExecutor[ChannelWithMessage] // contains filtered or unexported methods }
type CreateMessageBuilder ¶
type CreateMessageBuilder interface { BuilderExecutor[Message] // contains filtered or unexported methods }
type CreateThreadChannelBuilder ¶
type CreateThreadChannelBuilder interface { BuilderExecutorReason[Channel] ExpandableCreateThreadChannelBuilder[CreateThreadChannelBuilder] }
type CreateThreadTypeSelector ¶
type CreateThreadTypeSelector interface { Public() CreateThreadChannelBuilder Private() CreateThreadChannelBuilder News() CreateThreadChannelBuilder }
type EmbedAuthor ¶
type EmbedField ¶
type EmbedFooter ¶
type EmbedFooter struct {}
type EmbedMedia ¶
type EmbedProvider ¶
type Emoji ¶
type Emoji struct { Name string `json:"name"` Roles []snowflake.ID `json:"roles,omitempty"` User User `json:"user,omitempty"` ID snowflake.ID `json:"id"` GuildID snowflake.ID `json:"-"` RequireColons bool `json:"require_colons,omitempty"` Managed bool `json:"managed,omitempty"` Animated bool `json:"animated,omitempty"` Available bool `json:"available,omitempty"` }
Emoji
Reference: https://discord.com/developers/docs/resources/emoji#emoji-object
func (Emoji) Guild ¶
func (v Emoji) Guild(client ClientQuery) GuildQuery
type ExpandableGuildChannelBuilder ¶
type ExpandableGuildChannelBuilder[B any] interface { Type(t ChannelType) B Topic(topic string) B Bitrate(bitrate uint64) B UserLimit(limit uint16) B RateLimitPerUser(limit uint32) B Position(pos int) B Parent(id snowflake.ID) B NSFW(isNSFW bool) B Overwrites(perms []permissions.Overwrite) B Builder() B }
type ExpandableUpdateGuildChannelBuilder ¶
type ExpandableUpdateGuildChannelBuilder[B any] interface { ExpandableGuildChannelBuilder[UpdateGuildChannelBuilder] Name(name string) B }
type ExpandableUpdateThreadChannelBuilder ¶
type ExpandableUpdateThreadChannelBuilder[B any] interface { ExpandableCreateThreadChannelBuilder[B] Name(name string) B }
type ExpandableWebhookExecuteBuilder ¶
type ExpandableWebhookExecuteBuilder[B any] interface { BaseMessageBuilder[B] AvatarURL(url string) B Username(name string) B Thread(id snowflake.ID) B NoWait() B }
type ExpandableWebhookUpdateMessageBuilder ¶
type ExpandableWebhookUpdateMessageBuilder[B any] interface { BaseMessageBuilder[B] Thread(id snowflake.ID) B }
type ForumMessageCreate ¶
type ForumMessageCreate struct { Message MessageCreate `json:"message"` Name *string `json:"name,omitempty"` AutoArchiveDuration *ThreadArchiveDuration `json:"auto_archive_duration,omitempty"` RateLimitPerUser uint32 `json:"rate_limit_per_user,omitempty"` AppliedTags []snowflake.ID `json:"applied_tags,omitempty"` }
type ForumSortOrder ¶
type ForumSortOrder uint8
const ( ForumSortOrderLatestActivity ForumSortOrder = iota ForumSortOrderCreationDate )
type Guild ¶
type Guild struct { JoinedAt timeconv.Timestamp `json:"joined_at"` Banner string `json:"banner"` Name string `json:"name"` IconHash string `json:"icon_hash"` Splash string `json:"splash"` VanityUrlCode string `json:"vanity_url_code"` PreferredLocale string `json:"preferred_locale"` DiscoverySplash string `json:"discovery_splash"` Icon string `json:"icon"` Permissions string `json:"permissions"` Description string `json:"description"` Features []string `json:"features"` Stickers []GuildSticker `json:"stickers"` Roles RoleSlice `json:"roles"` Emojis []Emoji `json:"emojis"` AFKTimeout timeconv.Seconds `json:"afk_timeout"` MFALevel int `json:"mfa_level"` ApplicationID snowflake.ID `json:"application_id"` SystemChannelID snowflake.ID `json:"system_channel_id"` SystemChannelFlags int `json:"system_channel_flags"` RulesChannelID snowflake.ID `json:"rules_channel_id"` OwnerID snowflake.ID `json:"owner_id"` PublicUpdatesChannelID snowflake.ID `json:"public_updates_channel_id"` AFKChannelID snowflake.ID `json:"afk_channel_id"` PremiumSubscriptionCount int `json:"premium_subscription_count"` MaxPresences int `json:"max_presences"` MaxMembers int `json:"max_members"` WidgetChannelID snowflake.ID `json:"widget_channel_id"` MaxVideoChannelUsers int `json:"max_video_channel_users"` MemberCount int `json:"member_count"` ID snowflake.ID `json:"id"` PremiumTier GuildPremiumTier `json:"premium_tier"` ExplicitContentFilter GuildExplicitContentFilter `json:"explicit_content_filter"` DefaultMessageNotifications GuildDefaultNotifications `json:"default_message_notifications"` NSFWLevel GuildNSFWLevel `json:"nsfw_level"` VerificationLevel GuildVerificationLevel `json:"verification_level"` WidgetEnabled bool `json:"widget_enabled"` PremiumProgressBarEnabled bool `json:"premium_progress_bar_enabled"` Large bool `json:"large"` }
func (Guild) IconURL ¶ added in v0.1.5
IconURL returns a URL of Guild icon.
Size can be any power of two between 16 and 4096 (use constants from cdn package, or 0 for default).
func (Guild) MemberPermissions ¶
func (v Guild) MemberPermissions(api ClientQuery, member snowflake.ID) (perm permissions.Permission, err error)
type GuildBuilder ¶
type GuildBuilder interface { Name(str string) GuildBuilder Description(desc string) GuildBuilder PremiumProgressBar(enabled bool) GuildBuilder VerificationLevel(lvl GuildVerificationLevel) GuildBuilder DefaultMessageNotifications(n GuildDefaultNotifications) GuildBuilder ExplicitContentFilter(f GuildExplicitContentFilter) GuildBuilder AFKChannelID(id snowflake.ID) GuildBuilder AFKTimeout(timeout uint32) GuildBuilder Icon(image *images.MediaBuilder) GuildBuilder TransferOwner(id snowflake.ID) GuildBuilder Splash(image *images.MediaBuilder) GuildBuilder DiscoverySplash(image *images.MediaBuilder) GuildBuilder Banner(image *images.MediaBuilder) GuildBuilder SystemChannel(id snowflake.ID, flags ...SystemChannelFlag) GuildBuilder RulesChannel(id snowflake.ID) GuildBuilder PublicUpdatesChannel(id snowflake.ID) GuildBuilder Locale(l string) GuildBuilder Execute(api ClientQuery, reason ...string) (guild *Guild, err error) }
type GuildChannelBuilder ¶
type GuildChannelBuilder interface { BuilderExecutorReason[Channel] ExpandableGuildChannelBuilder[GuildChannelBuilder] }
type GuildChannelPositions ¶
type GuildChannelPositionsBuilder ¶
type GuildChannelPositionsBuilder struct {
// contains filtered or unexported fields
}
func NewGuildChannelPositionsBuilder ¶
func NewGuildChannelPositionsBuilder(channels []Channel) (x *GuildChannelPositionsBuilder)
func (GuildChannelPositionsBuilder) Encode ¶
func (x GuildChannelPositionsBuilder) Encode() (res []map[string]any)
func (GuildChannelPositionsBuilder) Pos ¶
func (x GuildChannelPositionsBuilder) Pos(id snowflake.ID, pos int)
type GuildDefaultNotifications ¶
type GuildDefaultNotifications uint8
const ( GuildDefaultNotificationsAll GuildDefaultNotifications = iota GuildDefaultNotificationsMentions )
type GuildExplicitContentFilter ¶
type GuildExplicitContentFilter uint8
const ( GuildExplicitContentFilterDisabled GuildExplicitContentFilter = iota GuildExplicitContentFilterWithoutRoles GuildExplicitContentFilterAll )
type GuildMemberQuery ¶
type GuildMemberQuery interface { QueryOptions[GuildMemberQuery] Get() (member *MemberWithUser, err error) Ban(days uint8) (err error) Unban() (err error) AddRole(role snowflake.ID) (err error) RemoveRole(role snowflake.ID) (err error) Kick() (err error) Edit() UpdateGuildMemberBuilder Permissions() (perm permissions.Permission, err error) PermissionsIn(channel snowflake.ID) (perm permissions.Permission, err error) VoiceState() (state *VoiceState, err error) ID() snowflake.ID GuildID() snowflake.ID }
type GuildNSFWLevel ¶
type GuildNSFWLevel uint8
const ( GuildNSFWDefault GuildNSFWLevel = iota GuildNSFWExplicit GuildNSFWSafe GuildNSFWAgeRestricted )
type GuildPremiumTier ¶
type GuildPremiumTier uint8
const ( GuildPremiumNone GuildPremiumTier = iota GuildPremiumTier1 GuildPremiumTier2 GuildPremiumTier3 )
type GuildQuery ¶
type GuildQuery interface { QueryOptions[GuildQuery] Get() (guild *Guild, err error) Delete() (err error) Channels() (channels []Channel, err error) CreateChannel(name string) GuildChannelBuilder Edit() GuildBuilder UpdateChannelPositions(positions *GuildChannelPositionsBuilder) (err error) ActiveThreads() (threads []Channel, err error) Member(id snowflake.ID) GuildMemberQuery Search(query string, limit uint16) (members []MemberWithUser, err error) SetCurrentNick(nick string) (err error) Roles() (roles RoleSlice, err error) VoiceStates() (states Slice[VoiceState], err error) Invites() (invites []InviteWithMeta, err error) Role(id snowflake.ID) RoleQuery CreateRole() RoleBuilder UpdateRolePositions(roles RolePositions) error // Members gets the guild members from API and store them in cache (if enabled) // // limit variable has no upper value, so if you set it to more than 1000 (theoretically Discord API limit) the library will just make appropriate number of requests. // if limit is set to -1, bfcord will try to fetch all guild members. Members(limit int, after snowflake.ID) (members []MemberWithUser, err error) }
type GuildScheduledEvent ¶
type GuildScheduledEvent struct { ScheduledStartTime timeconv.Timestamp `json:"scheduled_start_time"` ScheduledEndTime timeconv.Timestamp `json:"scheduled_end_time"` EntityMetadata ScheduledEventMeta `json:"entity_metadata"` Name string `json:"name"` Description string `json:"description"` Creator User `json:"creator"` ID snowflake.ID `json:"id"` CreatorID snowflake.ID `json:"creator_id"` PrivacyLevel int `json:"privacy_level"` ChannelID snowflake.ID `json:"channel_id"` GuildID snowflake.ID `json:"guild_id"` EntityID snowflake.ID `json:"entity_id"` UserCount int `json:"user_count"` EntityType ScheduledEventType `json:"entity_type"` Status ScheduledEventStatus `json:"status"` }
GuildScheduledEvent
type GuildSticker ¶
type GuildSticker struct { Name string `json:"name"` Description string `json:"description"` Tags string `json:"tags"` User User `json:"user"` ID snowflake.ID `json:"id"` GuildID snowflake.ID `json:"guild_id"` PackID snowflake.ID `json:"pack_id"` SortValue int `json:"sort_value"` Available bool `json:"available"` }
type GuildUpdate ¶
type GuildUpdate struct { Name *string `json:"name,omitempty"` VerificationLevel *GuildVerificationLevel `json:"verification_level,omitempty"` DefaultMessageNotifications *GuildDefaultNotifications `json:"default_message_notifications,omitempty"` ExplicitContentFilter *GuildExplicitContentFilter `json:"explicit_content_filter,omitempty"` AFKChannelID *nullable.Nullable[snowflake.ID] `json:"afk_channel_id,omitempty"` AFKTimeout *uint32 `json:"afk_timeout,omitempty"` Icon *nullable.Nullable[string] `json:"icon,omitempty"` OwnerID *snowflake.ID `json:"owner_id,omitempty"` Splash *nullable.Nullable[string] `json:"splash,omitempty"` DiscoverySplash *nullable.Nullable[string] `json:"discovery_splash,omitempty"` Banner *nullable.Nullable[string] `json:"banner,omitempty"` SystemChannelID *nullable.Nullable[snowflake.ID] `json:"system_channel_id,omitempty"` SystemChannelFlags *SystemChannelFlag `json:"system_channel_flags,omitempty"` RulesChannelID *snowflake.ID `json:"rules_channel_id,omitempty"` PublicUpdatesChannelID *snowflake.ID `json:"public_updates_channel_id,omitempty"` PreferredLocale *string `json:"preferred_locale,omitempty"` Description *string `json:"description,omitempty"` PremiumProgressBarEnabled *bool `json:"premium_progress_bar_enabled,omitempty"` }
type GuildVerificationLevel ¶
type GuildVerificationLevel uint8
const ( GuildVerificationNone GuildVerificationLevel = iota GuildVerificationLow GuildVerificationMedium GuildVerificationHigh GuildVerificationVeryHigh )
type GuildWithData ¶
type GuildWithData struct { Members []MemberWithUser `json:"members"` Channels []Channel `json:"channels"` Threads []Channel `json:"threads"` Presences []Presence `json:"presences"` VoiceStates []VoiceState `json:"voice_states"` StageInstances []StageInstance `json:"stage_instances"` ScheduledEvents []GuildScheduledEvent `json:"guild_scheduled_events"` Owner User `json:"owner"` Guild }
func (*GuildWithData) Patch ¶
func (g *GuildWithData) Patch()
type Integration ¶
type Integration struct { Account struct { ID string `json:"id"` Name string `json:"name"` } `json:"account"` Type string `json:"type"` SyncedAt string `json:"synced_at"` Name string `json:"name"` User User `json:"user"` GuildID snowflake.ID `json:"guild_id"` SubscriberCount int `json:"subscriber_count"` RoleID snowflake.ID `json:"role_id"` ID snowflake.ID `json:"id"` ExpireGracePeriod int `json:"expire_grace_period"` EnableEmoticons bool `json:"enable_emoticons"` ExpireBehavior IntegrationExpireBehavior `json:"expire_behavior"` Syncing bool `json:"syncing"` Enabled bool `json:"enabled"` Revoked bool `json:"revoked"` }
type IntegrationExpireBehavior ¶
type IntegrationExpireBehavior uint8
const ( ExpireBehaviorRemoveRole IntegrationExpireBehavior = iota ExpireBehaviorKickUser )
type Invite ¶
type Invite struct { ExpiresAt timeconv.Timestamp `json:"expires_at,omitempty"` Guild *Guild `json:"guild,omitempty"` Inviter *User `json:"inviter,omitempty"` GuildScheduledEvent *GuildScheduledEvent `json:"guild_scheduled_event,omitempty"` TargetUser *User `json:"target_user,omitempty"` Channel *Channel `json:"channel,omitempty"` StageInstance *StageInstance `json:"stage_instance,omitempty"` Code string `json:"code,omitempty"` PresenceCount uint32 `json:"approximate_presence_count,omitempty"` MemberCount uint32 `json:"approximate_member_count,omitempty"` TargetType InviteTargetType `json:"target_type,omitempty"` }
type InviteQuery ¶
type InviteQuery interface { }
type InviteTargetType ¶
type InviteTargetType uint8
const ( TargetTypeStream InviteTargetType = iota + 1 TargetTypeEmbeddedApplication )
type InviteWithMeta ¶
type LowLevelClientQuery ¶
type LowLevelClientQuery interface { QueryOptions[LowLevelClientQuery] CreateMessage(channel snowflake.ID, data MessageCreate) (msg *Message, err error) UpdateMessage(channel snowflake.ID, message snowflake.ID, data MessageCreate) (msg *Message, err error) ExecuteWebhook(id snowflake.ID, token string, data WebhookExecute, wait bool, thread snowflake.ID) (msg *Message, err error) UpdateWebhookMessage(id snowflake.ID, token string, message snowflake.ID, data MessageCreate, thread snowflake.ID) (msg *Message, err error) Message(method string, url string, _data any) (msg *Message, err error) UpdateChannel(id snowflake.ID, data ChannelUpdate) (ch *Channel, err error) CreateGuildChannel(guild snowflake.ID, data ChannelUpdate) (ch *Channel, err error) UpdateGuildMember(guild snowflake.ID, member snowflake.ID, data MemberUpdate) (m *MemberWithUser, err error) UpdateGuild(guild snowflake.ID, data GuildUpdate) (g *Guild, err error) SendDM(channel snowflake.ID) (msg CreateMessageBuilder) StartThread(channel snowflake.ID, message snowflake.ID, data ThreadCreate) (ch *Channel, err error) CreateOrUpdate(guild, role snowflake.ID, data RoleCreate) (r *Role, err error) CreateForumMessage(id snowflake.ID, data ForumMessageCreate) (d *ChannelWithMessage, err error) }
type Member ¶
type Member struct { JoinedAt timeconv.Timestamp `json:"joined_at"` PremiumSince timeconv.Timestamp `json:"premium_since"` Nick string `json:"nick"` Avatar string `json:"avatar"` CommunicationDisabledUntil string `json:"communication_disabled_until"` Roles []snowflake.ID `json:"roles"` UserID snowflake.ID `json:"user_id"` GuildID snowflake.ID `json:"guild_id"` Deaf bool `json:"deaf"` Mute bool `json:"mute"` Pending bool `json:"pending"` }
Member
Reference: https://discord.com/developers/docs/resources/guild#guild-member-object
func (Member) API ¶
func (x Member) API(client ClientQuery) GuildMemberQuery
func (Member) Guild ¶
func (x Member) Guild(client ClientQuery) GuildQuery
func (Member) Kick ¶
func (x Member) Kick(client ClientQuery) error
func (Member) Permissions ¶
func (x Member) Permissions(bot ClientQuery) (perm permissions.Permission, err error)
func (Member) PermissionsIn ¶
func (x Member) PermissionsIn(bot ClientQuery, channel snowflake.ID) (resperm permissions.Permission, err error)
func (Member) User ¶
func (x Member) User(client ClientQuery) UserQuery
type MemberUpdate ¶
type MemberUpdate struct { Nick *string `json:"nick,omitempty"` Roles *[]snowflake.ID `json:"roles,omitempty"` Mute *bool `json:"mute,omitempty"` Deaf *bool `json:"deaf,omitempty"` ChannelID *nullable.Nullable[snowflake.ID] `json:"channel_id,omitempty"` CommunicationDisabledUntil *timeconv.Timestamp `json:"communication_disabled_until,omitempty"` }
type MemberWithUser ¶
type Message ¶
type Message struct { Reactions ReactionStore `json:"reactions"` Member Member `json:"member"` Author User `json:"author"` BaseMessage }
Message
Reference: https://discord.com/developers/docs/resources/channel#message-object
func (*Message) Fetch ¶
func (v *Message) Fetch(api ClientQuery) error
type MessageActivity ¶
type MessageActivity struct { PartyID string `json:"party_id"` Type MessageActivityType `json:"type"` }
type MessageActivityType ¶
type MessageActivityType uint8
const ( MessageActivityJoin MessageActivityType = iota + 1 MessageActivitySpectate MessageActivityListen MessageActivityJoinRequest )
type MessageAllowedMentions ¶ added in v0.1.10
type MessageAllowedMentions struct { // Supported values: roles, users, everyone Parse []string `json:"parse"` Roles []snowflake.ID `json:"roles,omitempty"` Users []snowflake.ID `json:"users,omitempty"` RepliedUser bool `json:"replied_user,omitempty"` }
MessageAllowedMentions
type MessageBuilder ¶
type MessageBuilder interface { BuilderExecutor[Message] BaseMessageBuilder[MessageBuilder] }
type MessageChannelMention ¶
type MessageChannelMention struct { Name string `json:"name"` ID snowflake.ID `json:"id"` GuildID snowflake.ID `json:"guild_id"` Type ChannelType `json:"type"` }
type MessageCreate ¶
type MessageCreate struct { Content *string `json:"content,omitempty"` TTS *bool `json:"tts,omitempty"` MessageReference *MessageReference `json:"message_reference,omitempty"` Embeds *[]MessageEmbed `json:"embeds,omitempty"` Files *[]MessageFile `json:"-"` Attachments *[]Attachment `json:"attachments,omitempty"` Components *[]components.Component `json:"components,omitempty"` AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"` }
type MessageEmbed ¶
type MessageEmbed struct { Timestamp *timeconv.Timestamp `json:"timestamp,omitempty"` Author *EmbedAuthor `json:"author,omitempty"` Provider *EmbedProvider `json:"provider,omitempty"` Type EmbedType `json:"type,omitempty"` Description string `json:"description,omitempty"` Url string `json:"url,omitempty"` Title string `json:"title,omitempty"` Fields []EmbedField `json:"fields,omitempty"` Thumbnail *EmbedMedia `json:"thumbnail,omitempty"` Video *EmbedMedia `json:"video,omitempty"` Image *EmbedMedia `json:"image,omitempty"` Color int64 `json:"color,omitempty"` }
MessageEmbed
Reference: https://discord.com/developers/docs/resources/channel#embed-object
type MessageFile ¶
type MessageInteraction ¶
type MessageQuery ¶
type MessageQuery interface { Edit() MessageBuilder Delete() (err error) React(emoji string) error Reaction(emoji string) MessageReactionQuery RemoveAllReactions() (err error) Get() (msg *Message, err error) CrossPost() error Pin() error UnPin() error StartThread(name string) CreateThreadChannelBuilder ChannelID() snowflake.ID ID() snowflake.ID }
type MessageReaction ¶
type MessageReaction struct { Emoji Emoji `json:"emoji"` ChannelID snowflake.ID `json:"-"` MessageID snowflake.ID `json:"-"` Count int `json:"count"` Me bool `json:"me"` }
func (MessageReaction) API ¶
func (v MessageReaction) API(api ClientQuery) MessageReactionQuery
func (MessageReaction) Channel ¶
func (v MessageReaction) Channel(api ClientQuery) ChannelQuery
func (MessageReaction) Message ¶
func (v MessageReaction) Message(api ClientQuery) MessageQuery
func (MessageReaction) Remove ¶
func (v MessageReaction) Remove(api ClientQuery, userID snowflake.ID) error
func (MessageReaction) RemoveOwn ¶
func (v MessageReaction) RemoveOwn(api ClientQuery) error
func (MessageReaction) Users ¶
func (v MessageReaction) Users(api ClientQuery, limit uint64) ([]User, error)
type MessageReactionQuery ¶
type MessageReactionQuery interface { QueryOptions[MessageReactionQuery] RemoveOwn() (err error) After(limit uint64, after snowflake.ID) (users []User, err error) Range(limit uint64, after snowflake.ID) (users []User, err error) All(limit uint64) (users []User, err error) Remove(userID snowflake.ID) (err error) RemoveAll() (err error) Emoji() string Message() snowflake.ID Channel() snowflake.ID }
type MessageReference ¶
type MessageReference struct { MessageID snowflake.ID `json:"message_id"` ChannelID snowflake.ID `json:"channel_id,omitempty"` GuildID snowflake.ID `json:"guild_id,omitempty"` }
type MessageType ¶
type MessageType uint8
const ( MessageTypeDefault MessageType = iota MessageTypeRecipientAdd MessageTypeRecipientRemove MessageTypeCall MessageTypeChannelNameChange MessageTypeChannelIconChange MessageTypeChannelPinnedMessage MessageTypeGuildMemberJoin MessageTypeGuildSubscription MessageTypeGuildSubscriptionTier1 MessageTypeGuildSubscriptionTier2 MessageTypeGuildSubscriptionTier3 MessageTypeChannelFollowAdd MessageTypeDiscoveryDisqualified MessageTypeDiscoveryReQualified MessageTypeDiscoveryInitialWarning MessageTypeDiscoveryFinalWarning MessageTypeThreadCreated MessageTypeReply MessageTypeChatInputCommand MessageTypeThreadStarterMessage MessageTypeGuildInviteReminder MessageTypeContextMenuCommand )
type Presence ¶
type Presence struct { BasePresence User User `json:"user"` }
Presence
Reference: https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields
type PresenceClientStatus ¶
type PresenceClientStatus struct { Desktop PresenceStatus `json:"desktop"` Mobile PresenceStatus `json:"mobile"` Web PresenceStatus `json:"web"` }
type PresenceStatus ¶
type PresenceStatus string
type QueryOptions ¶
type ReactionStore ¶
type ReactionStore []MessageReaction
func (ReactionStore) Get ¶
func (v ReactionStore) Get(emoji string) (reaction MessageReaction, ok bool)
type Role ¶
type Role struct { Name string `json:"name"` Icon string `json:"icon,omitempty"` UnicodeEmoji string `json:"unicode_emoji,omitempty"` Permissions permissions.Permission `json:"permissions"` Tags RoleTags `json:"tags,omitempty"` ID snowflake.ID `json:"id"` Color int `json:"color"` Position int `json:"position"` GuildID snowflake.ID `json:"guild_id"` Hoist bool `json:"hoist"` Managed bool `json:"managed"` Mentionable bool `json:"mentionable"` }
Role
Reference: https://discord.com/developers/docs/topics/permissions#role-object
func (Role) ComparePosition ¶ added in v0.1.5
ComparePosition compares this role's position to other one.
func (Role) Guild ¶
func (r Role) Guild(api ClientQuery) GuildQuery
type RoleBuilder ¶
type RoleBuilder interface { Name(str string) RoleBuilder Permissions(perms permissions.Permission) RoleBuilder Color(c int64) RoleBuilder ShowSeparately(bool) RoleBuilder Icon(i *images.MediaBuilder) RoleBuilder UnicodeEmoji(str string) RoleBuilder Mentionable(bool) RoleBuilder Execute(api ClientQuery, reasons ...string) (role *Role, err error) }
type RoleCreate ¶
type RoleCreate struct { Name *string `json:"name,omitempty"` Permissions *permissions.Permission `json:"permissions,omitempty"` Color *int64 `json:"color,omitempty"` Hoist *bool `json:"hoist,omitempty"` Icon *string `json:"icon,omitempty"` UnicodeEmoji *string `json:"unicode_emoji,omitempty"` Mentionable *bool `json:"mentionable,omitempty"` }
type RolePositions ¶
type RolePositions []Role
func (*RolePositions) Map ¶
func (r *RolePositions) Map() (d []map[string]any)
func (*RolePositions) Set ¶
func (r *RolePositions) Set(role snowflake.ID, pos uint8) error
type RoleQuery ¶
type RoleQuery interface { QueryOptions[RoleQuery] Edit() RoleBuilder Delete() error }
type RoleSlice ¶ added in v0.1.5
type RoleSlice []Role
func (RoleSlice) HighestWithin ¶ added in v0.1.5
type RoleTags ¶
type RoleTags struct { BotID snowflake.ID `json:"bot_id,omitempty"` IntegrationID snowflake.ID `json:"integration_id,omitempty"` PremiumSubscriber snowflake.ID `json:"premium_subscriber,omitempty"` }
RoleTags
Reference: https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure
type ScheduledEventMeta ¶
type ScheduledEventMeta struct {
Location string `json:"location"`
}
type ScheduledEventStatus ¶
type ScheduledEventStatus uint8
const ( ScheduledEventStatusScheduled ScheduledEventStatus = iota + 1 ScheduledEventStatusActive ScheduledEventStatusCompleted ScheduledEventStatusCanceled )
type ScheduledEventType ¶
type ScheduledEventType uint8
const ( ScheduledEventStage ScheduledEventType = iota + 1 ScheduledEventVoice ScheduledEventExternal )
type StageInstance ¶
type StageInstance struct { Topic string `json:"topic"` ID snowflake.ID `json:"id"` GuildID snowflake.ID `json:"guild_id"` ChannelID snowflake.ID `json:"channel_id"` PrivacyLevel int `json:"privacy_level"` DiscoverableDisabled bool `json:"discoverable_disabled"` }
StageInstance
type StageQuery ¶
type StageQuery interface { QueryOptions[StageQuery] Create(topic string, notify bool) (stage *StageInstance, err error) Get() (stage *StageInstance, err error) Modify(topic string) (stage *StageInstance, err error) Delete() error }
type SystemChannelFlag ¶
type SystemChannelFlag uint8
const ( ChannelFlagDisableMemberJoin SystemChannelFlag = 1 << iota ChannelFlagDisableBoost ChannelFlagDisableSetupTips ChannelFlagDisableReplyButton )
type ThreadArchiveDuration ¶
type ThreadArchiveDuration uint16
const ( ThreadArchiveHour ThreadArchiveDuration = 60 ThreadArchiveDay ThreadArchiveDuration = 1440 ThreadArchive3Days ThreadArchiveDuration = 4320 ThreadArchiveWeek ThreadArchiveDuration = 10080 )
type ThreadCreate ¶
type ThreadCreate struct { Name *string `json:"name,omitempty"` AutoArchiveDuration *ThreadArchiveDuration `json:"auto_archive_duration,omitempty"` Type *ChannelType `json:"type,omitempty"` Invitable *bool `json:"invitable,omitempty"` RateLimitPerUser uint32 `json:"rate_limit_per_user,omitempty"` }
type ThreadMember ¶
type ThreadMetadata ¶
type UpdateChannelTypeSelector ¶
type UpdateChannelTypeSelector interface { Thread() UpdateThreadChannelBuilder Guild() UpdateGuildChannelBuilder }
type UpdateGuildChannelBuilder ¶
type UpdateGuildChannelBuilder interface { BuilderExecutorReason[Channel] ExpandableUpdateGuildChannelBuilder[UpdateGuildChannelBuilder] }
type UpdateGuildMemberBuilder ¶
type UpdateGuildMemberBuilder interface { Nick(name string) UpdateGuildMemberBuilder Roles(roles []snowflake.ID) UpdateGuildMemberBuilder Mute(isMuted bool) UpdateGuildMemberBuilder Deaf(isDeafened bool) UpdateGuildMemberBuilder VoiceChannel(channel snowflake.ID) UpdateGuildMemberBuilder DisableCommunicationUntil(t time.Time) UpdateGuildMemberBuilder Execute(api ClientQuery, reason ...string) (member *MemberWithUser, err error) }
type UpdateThreadChannelBuilder ¶
type UpdateThreadChannelBuilder interface { BuilderExecutorReason[Channel] ExpandableUpdateThreadChannelBuilder[UpdateThreadChannelBuilder] }
type User ¶
type User struct { // The user's banner hash, not url! Banner string `json:"banner,omitempty"` Username string `json:"username"` // new username, or old without # Discriminator string `json:"discriminator"` // 0 if user has a new username, might be null somewhat later as per docs GlobalName string `json:"global_name"` // new display name // Discord user's avatar HASH, NOT URL! // // To generate URL use User.AvatarURL method. Avatar string `json:"avatar,omitempty"` Locale string `json:"locale,omitempty"` AccentColor int64 `json:"accent_color,omitempty"` ID snowflake.ID `json:"id"` PublicFlags UserFlag `json:"public_flags"` Flags UserFlag `json:"flags"` IsSystem bool `json:"system"` IsBot bool `json:"bot"` IsVerified bool `json:"verified"` PremiumType UserPremiumType `json:"premium_type"` HasMFA bool `json:"mfa_enabled,omitempty"` }
User
Discord reference: https://discord.com/developers/docs/resources/user#user-object-user-structure
type UserFlag ¶
type UserFlag uint32
const ( StaffUserFlag UserFlag = 1 << 0 PartnerUserFlag UserFlag = 1 << 1 HypeSquadUserFlag UserFlag = 1 << 2 BugHunter1UserFlag UserFlag = 1 << 3 HypeSquadHouse1UserFlag UserFlag = 1 << 6 HypeSquadHouse2UserFlag UserFlag = 1 << 7 HypeSquadHouse3UserFlag UserFlag = 1 << 8 EarlySupporterUserFlag UserFlag = 1 << 9 PseudoTeamUserFlag UserFlag = 1 << 10 BugHunter2UserFlag UserFlag = 1 << 14 VerifiedBotUserFlag UserFlag = 1 << 16 VerifiedDeveloperUserFlag UserFlag = 1 << 17 CertifiedDiscordModeratorUserFlag UserFlag = 1 << 18 HttpInteractionsOnlyUserFlag UserFlag = 1 << 19 ActiveDeveloperUserFlag UserFlag = 1 << 22 )
type UserPremiumType ¶
type UserPremiumType uint8
const ( NonePremiumType UserPremiumType = iota NitroClassicPremiumType NitroPremiumType )
type UserQuery ¶
type UserQuery interface { QueryOptions[UserQuery] // Get returns User type from cache (if used) or directly from Discord API Get() (user *User, err error) // Send creates DM channel with user and sends defined message Send() (msg CreateMessageBuilder, err error) // CreateDM creates a private channel with user CreateDM() (ch *Channel, err error) ID() snowflake.ID }
type VoiceState ¶
type VoiceState struct { RequestToSpeakTimestamp timeconv.Timestamp `json:"request_to_speak_timestamp"` SessionID string `json:"session_id"` Member Member `json:"member"` ChannelID snowflake.ID `json:"channel_id"` UserID snowflake.ID `json:"user_id"` GuildID snowflake.ID `json:"guild_id"` Deaf bool `json:"deaf"` SelfDeaf bool `json:"self_deaf"` SelfMute bool `json:"self_mute"` SelfStream bool `json:"self_stream"` SelfVideo bool `json:"self_video"` Suppress bool `json:"suppress"` Mute bool `json:"mute"` }
VoiceState
Reference: https://discord.com/developers/docs/resources/voice#voice-state-object
type Webhook ¶
type Webhook struct { Avatar string `json:"avatar"` Token string `json:"token"` Name string `json:"name"` Url string `json:"url"` User User `json:"user"` SourceChannel Channel `json:"source_channel"` SourceGuild Guild `json:"source_guild"` GuildID snowflake.ID `json:"guild_id"` ID snowflake.ID `json:"id"` Type int `json:"type"` ApplicationID snowflake.ID `json:"application_id"` ChannelID snowflake.ID `json:"channel_id"` }
type WebhookCreate ¶ added in v0.1.3
type WebhookExecute ¶
type WebhookExecute struct { MessageCreate Username *string `json:"username,omitempty"` AvatarURL *string `json:"avatar_url,omitempty"` }
type WebhookExecuteBuilder ¶
type WebhookExecuteBuilder interface { Execute() (msg *Message, err error) ExpandableWebhookExecuteBuilder[WebhookExecuteBuilder] }
type WebhookQuery ¶
type WebhookQuery interface { Fetch() (wh *Webhook, err error) Execute() WebhookExecuteBuilder Delete() (err error) DeleteMessage(id snowflake.ID) (err error) EditMessage(id snowflake.ID) WebhookUpdateMessageBuilder }
type WebhookType ¶
type WebhookType uint8
const ( WebhookIncoming WebhookType = iota + 1 WebhookChannelFollower WebhookApplication )
type WebhookUpdateMessageBuilder ¶
type WebhookUpdateMessageBuilder interface { Execute() (msg *Message, err error) ExpandableWebhookUpdateMessageBuilder[WebhookUpdateMessageBuilder] }