core

package
v0.6.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCacheConfig = CacheConfig{
	CacheFlags:         CacheFlagsDefault,
	MemberCachePolicy:  MemberCachePolicyDefault,
	MessageCachePolicy: MessageCachePolicyDefault,
}
View Source
var (
	DefaultEventManagerConfig = EventManagerConfig{}
)

Functions

func GetMemberPermissions

func GetMemberPermissions(member *Member) discord.Permissions

GetMemberPermissions returns all Permissions from the provided Member

func GetMemberPermissionsInChannel

func GetMemberPermissionsInChannel(channel GuildChannel, member *Member) discord.Permissions

func LastPinTimestamp

func LastPinTimestamp(channel MessageChannel) *discord.Time

func NewCompetingPresence

func NewCompetingPresence(name string, status discord.OnlineStatus, afk bool) discord.UpdatePresenceCommandData

NewCompetingPresence creates a new Presence of type discord.ActivityTypeCompeting

func NewGamePresence

func NewGamePresence(name string, status discord.OnlineStatus, afk bool) discord.UpdatePresenceCommandData

NewGamePresence creates a new Presence of type discord.ActivityTypeGame

func NewListeningPresence

func NewListeningPresence(name string, status discord.OnlineStatus, afk bool) discord.UpdatePresenceCommandData

NewListeningPresence creates a new Presence of type discord.ActivityTypeListening

func NewPresence

func NewPresence(activityType discord.ActivityType, name string, url string, status discord.OnlineStatus, afk bool) discord.UpdatePresenceCommandData

NewPresence creates a new Presence with the provided properties

func NewStreamingPresence

func NewStreamingPresence(name string, url string, status discord.OnlineStatus, afk bool) discord.UpdatePresenceCommandData

NewStreamingPresence creates a new Presence of type discord.ActivityTypeStreaming

func NewWatchingPresence

func NewWatchingPresence(name string, status discord.OnlineStatus, afk bool) discord.UpdatePresenceCommandData

NewWatchingPresence creates a new Presence of type discord.ActivityTypeWatching

Types

type ApplicationCommand

type ApplicationCommand interface {
	discord.ApplicationCommand
}

type ApplicationCommandInteraction

type ApplicationCommandInteraction interface {
	discord.ApplicationCommandInteraction
}

ApplicationCommandInteraction represents a generic ApplicationCommand Interaction received from discord

type ApplicationCommandInteractionFilter

type ApplicationCommandInteractionFilter func(interaction Interaction) bool

type ApplicationCommandPermissions

type ApplicationCommandPermissions struct {
	discord.ApplicationCommandPermissions
	Bot *Bot
}

type ApplicationWebhook

type ApplicationWebhook struct {
	discord.ApplicationWebhook
	Bot *Bot
}

type AudioController

type AudioController interface {
	// Bot returns the core.Bot instance
	Bot() *Bot

	// Connect sends a discord.GatewayCommand to connect to the specified Channel
	Connect(ctx context.Context, guildID discord.Snowflake, channelID discord.Snowflake) error

	// Disconnect sends a discord.GatewayCommand to disconnect from a Channel
	Disconnect(ctx context.Context, guildID discord.Snowflake) error
}

AudioController lets you Connect / Disconnect from a Channel

func NewAudioController

func NewAudioController(bot *Bot) AudioController

type AuditLog

type AuditLog struct {
	discord.AuditLog
	GuildScheduledEvents map[discord.Snowflake]*GuildScheduledEvent
	Integrations         map[discord.Snowflake]Integration
	Threads              map[discord.Snowflake]GuildThread
	Users                map[discord.Snowflake]*User
	Webhooks             map[discord.Snowflake]Webhook
	GuildID              discord.Snowflake
	FilterOptions        AuditLogFilterOptions
	Bot                  *Bot
}

func (*AuditLog) Before

func (l *AuditLog) Before(opts ...rest.RequestOpt) (*AuditLog, error)

Before gets new AuditLog(s) from Discord before the last one

func (*AuditLog) Guild

func (l *AuditLog) Guild() *Guild

type AuditLogFilterOptions

type AuditLogFilterOptions struct {
	UserID     discord.Snowflake
	ActionType discord.AuditLogEvent
	Before     discord.Snowflake
	Limit      int
}

AuditLogFilterOptions fields used to filter audit-log retrieving

type AutocompleteInteraction

type AutocompleteInteraction struct {
	discord.AutocompleteInteraction
	*InteractionFields
	Data AutocompleteInteractionData
}

func (*AutocompleteInteraction) Channel

func (i *AutocompleteInteraction) Channel() Channel

Channel returns the Channel from the Caches

func (*AutocompleteInteraction) CommandPath

func (i *AutocompleteInteraction) CommandPath() string

CommandPath returns the ApplicationCommand path

func (*AutocompleteInteraction) Guild

func (i *AutocompleteInteraction) Guild() *Guild

Guild returns the Guild from the Caches

func (*AutocompleteInteraction) Respond

func (*AutocompleteInteraction) Result

func (*AutocompleteInteraction) ResultMapFloat

func (i *AutocompleteInteraction) ResultMapFloat(resultMap map[string]float64, opts ...rest.RequestOpt) error

func (*AutocompleteInteraction) ResultMapInt

func (i *AutocompleteInteraction) ResultMapInt(resultMap map[string]int, opts ...rest.RequestOpt) error

func (*AutocompleteInteraction) ResultMapString

func (i *AutocompleteInteraction) ResultMapString(resultMap map[string]string, opts ...rest.RequestOpt) error

type AutocompleteInteractionData

type AutocompleteInteractionData struct {
	discord.AutocompleteInteractionData
	SubCommandName      *string
	SubCommandGroupName *string
	Options             AutocompleteOptionsMap
}

type AutocompleteInteractionFilter

type AutocompleteInteractionFilter func(autocompleteInteraction *AutocompleteInteraction) bool

type AutocompleteOptionsMap

type AutocompleteOptionsMap map[string]discord.AutocompleteOption

func (AutocompleteOptionsMap) Bool

func (m AutocompleteOptionsMap) Bool(name string) *bool

func (AutocompleteOptionsMap) BoolOption

func (AutocompleteOptionsMap) ChannelOption

func (AutocompleteOptionsMap) Find

func (AutocompleteOptionsMap) FindAll

func (m AutocompleteOptionsMap) FindAll(optionFindFunc func(option discord.AutocompleteOption) bool) []discord.AutocompleteOption

func (AutocompleteOptionsMap) Float

func (m AutocompleteOptionsMap) Float(name string) *float64

func (AutocompleteOptionsMap) FloatOption

func (AutocompleteOptionsMap) Focused

func (m AutocompleteOptionsMap) Focused(name string) bool

func (AutocompleteOptionsMap) FocusedOption

func (AutocompleteOptionsMap) Get

func (AutocompleteOptionsMap) GetAll

func (AutocompleteOptionsMap) GetByType

func (AutocompleteOptionsMap) Int

func (m AutocompleteOptionsMap) Int(name string) *int

func (AutocompleteOptionsMap) IntOption

func (AutocompleteOptionsMap) MentionableOption

func (AutocompleteOptionsMap) RoleOption

func (AutocompleteOptionsMap) Snowflake

func (m AutocompleteOptionsMap) Snowflake(name string) *discord.Snowflake

func (AutocompleteOptionsMap) String

func (m AutocompleteOptionsMap) String(name string) *string

func (AutocompleteOptionsMap) StringOption

func (AutocompleteOptionsMap) UserOption

type Ban

type Ban struct {
	discord.Ban
	Bot     *Bot
	User    *User
	GuildID discord.Snowflake
}

Ban represents a banned User from a Guild (https://discord.com/developers/docs/resources/guild#ban-object)

func (*Ban) Unban

func (b *Ban) Unban(opts ...rest.RequestOpt) error

Unban unbans the User associated with this Ban from the Guild

type BaseGuildMessageChannel

type BaseGuildMessageChannel interface {
	discord.BaseGuildMessageChannel
	GuildChannel
	MessageChannel
}

type Bot

type Bot struct {
	Token         string
	ApplicationID discord.Snowflake
	ClientID      discord.Snowflake
	SelfUser      *SelfUser

	Logger log.Logger

	RestServices rest.Services

	EventManager EventManager
	Collectors   Collectors

	ShardManager sharding.ShardManager
	Gateway      gateway.Gateway

	HTTPServer httpserver.Server

	Caches Caches

	EntityBuilder         EntityBuilder
	AudioController       AudioController
	MemberChunkingManager MemberChunkingManager
}

Bot is the main discord client

func (*Bot) AddEventListeners

func (b *Bot) AddEventListeners(listeners ...EventListener)

AddEventListeners adds one or more EventListener(s) to the EventManager

func (*Bot) Close

func (b *Bot) Close(ctx context.Context) error

Close will clean up all disgo internals and close the discord connection safely

func (*Bot) ConnectGateway

func (b *Bot) ConnectGateway(ctx context.Context) error

ConnectGateway opens the gateway connection to discord

func (*Bot) ConnectShardManager

func (b *Bot) ConnectShardManager(ctx context.Context) error

ConnectShardManager opens the gateway connection to discord

func (*Bot) CreateCommand

func (b *Bot) CreateCommand(commandCreate discord.ApplicationCommandCreate, opts ...rest.RequestOpt) (ApplicationCommand, error)

CreateCommand creates a new global discord.ApplicationCommand

func (*Bot) CreateGuildCommand

func (b *Bot) CreateGuildCommand(guildID discord.Snowflake, commandCreate discord.ApplicationCommandCreate, opts ...rest.RequestOpt) (ApplicationCommand, error)

CreateGuildCommand creates a new Guild discord.ApplicationCommand

func (*Bot) CreateGuildFromTemplate

func (b *Bot) CreateGuildFromTemplate(templateCode string, createGuildFromTemplate discord.GuildFromTemplateCreate, opts ...rest.RequestOpt) (*Guild, error)

CreateGuildFromTemplate creates a core.Guild using a core.GuildTemplate code

func (*Bot) DeleteCommand

func (b *Bot) DeleteCommand(commandID discord.Snowflake, opts ...rest.RequestOpt) error

DeleteCommand creates a new global discord.ApplicationCommand

func (*Bot) DeleteGuildCommand

func (b *Bot) DeleteGuildCommand(guildID discord.Snowflake, commandID discord.Snowflake, opts ...rest.RequestOpt) error

DeleteGuildCommand creates a new Guild discord.ApplicationCommand

func (*Bot) DeleteInvite

func (b *Bot) DeleteInvite(inviteCode string, opts ...rest.RequestOpt) (*Invite, error)

func (*Bot) EditCommand

func (b *Bot) EditCommand(commandID discord.Snowflake, commandUpdate discord.ApplicationCommandUpdate, opts ...rest.RequestOpt) (ApplicationCommand, error)

EditCommand edits a specific global discord.ApplicationCommand

func (*Bot) EditGuildCommand

func (b *Bot) EditGuildCommand(guildID discord.Snowflake, commandID discord.Snowflake, commandUpdate discord.ApplicationCommandUpdate, opts ...rest.RequestOpt) (ApplicationCommand, error)

EditGuildCommand edits a specific Guild discord.ApplicationCommand

func (*Bot) GetCommand

func (b *Bot) GetCommand(commandID discord.Snowflake, opts ...rest.RequestOpt) (ApplicationCommand, error)

GetCommand fetches a specific global discord.ApplicationCommand

func (*Bot) GetCommands

func (b *Bot) GetCommands(opts ...rest.RequestOpt) ([]ApplicationCommand, error)

GetCommands fetches all global discord.ApplicationCommand(s)

func (*Bot) GetGuildCommand

func (b *Bot) GetGuildCommand(guildID discord.Snowflake, commandID discord.Snowflake, opts ...rest.RequestOpt) (ApplicationCommand, error)

GetGuildCommand fetches a specific Guild discord.ApplicationCommand

func (*Bot) GetGuildCommandPermissions

func (b *Bot) GetGuildCommandPermissions(guildID discord.Snowflake, commandID discord.Snowflake, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error)

GetGuildCommandPermissions returns the core.ApplicationCommandPermissions for a specific discord.ApplicationCommand in a core.Guild

func (*Bot) GetGuildCommands

func (b *Bot) GetGuildCommands(guildID discord.Snowflake, opts ...rest.RequestOpt) ([]ApplicationCommand, error)

GetGuildCommands fetches all Guild discord.ApplicationCommand(s)

func (*Bot) GetGuildCommandsPermissions

func (b *Bot) GetGuildCommandsPermissions(guildID discord.Snowflake, opts ...rest.RequestOpt) ([]*ApplicationCommandPermissions, error)

GetGuildCommandsPermissions returns the core.ApplicationCommandPermissions for an all discord.ApplicationCommand(s) in an core.Guild

func (*Bot) GetInvite

func (b *Bot) GetInvite(inviteCode string, opts ...rest.RequestOpt) (*Invite, error)

func (*Bot) GetNitroStickerPacks

func (b *Bot) GetNitroStickerPacks(opts ...rest.RequestOpt) ([]*StickerPack, error)

func (*Bot) GetSticker

func (b *Bot) GetSticker(stickerID discord.Snowflake, opts ...rest.RequestOpt) (*Sticker, error)

func (*Bot) GetTemplate

func (b *Bot) GetTemplate(code string, opts ...rest.RequestOpt) (*GuildTemplate, error)

GetTemplate gets a core.GuildTemplate by its code

func (*Bot) HasGateway

func (b *Bot) HasGateway() bool

HasGateway returns whether this Bot has an active gateway.Gateway connection

func (*Bot) HasHTTPServer

func (b *Bot) HasHTTPServer() bool

HasHTTPServer returns whether Bot has an active httpserver.Server

func (*Bot) HasShardManager

func (b *Bot) HasShardManager() bool

HasShardManager returns whether this Bot is sharded

func (*Bot) RemoveEventListeners

func (b *Bot) RemoveEventListeners(listeners ...EventListener)

RemoveEventListeners removes one or more EventListener(s) from the EventManager

func (*Bot) SelfMember

func (b *Bot) SelfMember(guildID discord.Snowflake) *Member

SelfMember returns a core.OAuth2User for the client, if available

func (*Bot) SetCommands

func (b *Bot) SetCommands(commandCreates []discord.ApplicationCommandCreate, opts ...rest.RequestOpt) ([]ApplicationCommand, error)

SetCommands overrides all global discord.ApplicationCommand(s)

func (*Bot) SetGuildCommandPermissions

func (b *Bot) SetGuildCommandPermissions(guildID discord.Snowflake, commandID discord.Snowflake, permissions []discord.ApplicationCommandPermission, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error)

SetGuildCommandPermissions sets the core.ApplicationCommandPermissions for a specific discord.ApplicationCommand

func (*Bot) SetGuildCommands

func (b *Bot) SetGuildCommands(guildID discord.Snowflake, commandCreates []discord.ApplicationCommandCreate, opts ...rest.RequestOpt) ([]ApplicationCommand, error)

SetGuildCommands overrides all Guild discord.ApplicationCommand(s)

func (*Bot) SetGuildCommandsPermissions

func (b *Bot) SetGuildCommandsPermissions(guildID discord.Snowflake, commandPermissions []discord.ApplicationCommandPermissionsSet, opts ...rest.RequestOpt) ([]*ApplicationCommandPermissions, error)

SetGuildCommandsPermissions sets the discord.ApplicationCommandPermissions for all discord.ApplicationCommand(s)

func (*Bot) SetPresence

func (b *Bot) SetPresence(ctx context.Context, presenceUpdate discord.UpdatePresenceCommandData) error

func (*Bot) SetPresenceForShard

func (b *Bot) SetPresenceForShard(ctx context.Context, shardId int, presenceUpdate discord.UpdatePresenceCommandData) error

SetPresenceForShard sets the Presence of this Bot for the provided shard

func (*Bot) Shard

func (b *Bot) Shard(guildID discord.Snowflake) (gateway.Gateway, error)

func (*Bot) StartHTTPServer

func (b *Bot) StartHTTPServer() error

StartHTTPServer starts the interaction webhook server

type BotIntegration

type BotIntegration struct {
	discord.BotIntegration
	Bot         *Bot
	GuildID     discord.Snowflake
	Application *IntegrationApplication
}

func (*BotIntegration) Delete

func (i *BotIntegration) Delete(opts ...rest.RequestOpt) error

Delete deletes the Integration from the Guild

func (*BotIntegration) Guild

func (i *BotIntegration) Guild() *Guild

Guild returns the Guild the Integration belongs to

type ButtonInteraction

type ButtonInteraction struct {
	discord.ButtonInteraction
	*InteractionFields
	Message *Message
}

func (*ButtonInteraction) ButtonComponent

func (i *ButtonInteraction) ButtonComponent() discord.ButtonComponent

ButtonComponent returns the ButtonComponent which issued this ButtonInteraction

func (*ButtonInteraction) Create

func (i *ButtonInteraction) Create(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) error

func (*ButtonInteraction) CreateFollowup

func (i *ButtonInteraction) CreateFollowup(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

func (*ButtonInteraction) DeferCreate

func (i *ButtonInteraction) DeferCreate(ephemeral bool, opts ...rest.RequestOpt) error

func (*ButtonInteraction) DeferUpdate

func (i *ButtonInteraction) DeferUpdate(opts ...rest.RequestOpt) error

func (*ButtonInteraction) DeleteFollowup

func (i *ButtonInteraction) DeleteFollowup(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*ButtonInteraction) DeleteOriginal

func (i *ButtonInteraction) DeleteOriginal(opts ...rest.RequestOpt) error

func (*ButtonInteraction) GetFollowup

func (i *ButtonInteraction) GetFollowup(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*ButtonInteraction) GetOriginal

func (i *ButtonInteraction) GetOriginal(opts ...rest.RequestOpt) (*Message, error)

func (*ButtonInteraction) Respond

func (i *ButtonInteraction) Respond(callbackType discord.InteractionCallbackType, callbackData discord.InteractionCallbackData, opts ...rest.RequestOpt) error

func (*ButtonInteraction) Update

func (i *ButtonInteraction) Update(messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) error

func (*ButtonInteraction) UpdateButton

func (i *ButtonInteraction) UpdateButton(button discord.ButtonComponent, opts ...rest.RequestOpt) error

UpdateButton updates the clicked ButtonComponent with a new ButtonComponent

func (*ButtonInteraction) UpdateFollowup

func (i *ButtonInteraction) UpdateFollowup(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

func (*ButtonInteraction) UpdateOriginal

func (i *ButtonInteraction) UpdateOriginal(messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

type ButtonInteractionFilter

type ButtonInteractionFilter func(buttonInteraction *ButtonInteraction) bool

ButtonInteractionFilter used to filter ButtonInteraction(s) in a collectors.ButtonClickCollector

type CacheConfig

type CacheConfig struct {
	CacheFlags         CacheFlags
	MemberCachePolicy  MemberCachePolicy
	MessageCachePolicy MessageCachePolicy
}

func (*CacheConfig) Apply

func (c *CacheConfig) Apply(opts []CacheConfigOpt)

type CacheConfigOpt

type CacheConfigOpt func(config *CacheConfig)

func WithCacheFlags

func WithCacheFlags(cacheFlags ...CacheFlags) CacheConfigOpt

func WithMemberCachePolicy

func WithMemberCachePolicy(memberCachePolicy MemberCachePolicy) CacheConfigOpt

func WithMessageCachePolicy

func WithMessageCachePolicy(messageCachePolicy MessageCachePolicy) CacheConfigOpt

type CacheFlags

type CacheFlags int

CacheFlags are used to enable/disable certain internal caches

const (
	CacheFlagGuilds CacheFlags = 1 << iota
	CacheFlagGuildScheduledEvents

	CacheFlagPresences

	CacheFlagGuildTextChannels
	CacheFlagDMChannels
	CacheFlagGuildVoiceChannels
	CacheFlagGroupDMChannels
	CacheFlagGuildCategories
	CacheFlagGuildNewsChannels
	CacheFlagGuildStoreChannels
	CacheFlagGuildNewsThreads
	CacheFlagGuildPublicThreads
	CacheFlagGuildPrivateThreads
	CacheFlagGuildStageVoiceChannels

	CacheFlagRoles
	CacheFlagRoleTags

	CacheFlagEmojis
	CacheFlagStickers

	CacheFlagVoiceStates

	CacheFlagStageInstances

	CacheFlagsNone CacheFlags = 0

	CacheFlagsAllChannels = CacheFlagGuildTextChannels |
		CacheFlagDMChannels |
		CacheFlagGuildVoiceChannels |
		CacheFlagGroupDMChannels |
		CacheFlagGuildCategories |
		CacheFlagGuildNewsChannels |
		CacheFlagGuildStoreChannels |
		CacheFlagGuildNewsThreads |
		CacheFlagGuildPublicThreads |
		CacheFlagGuildPrivateThreads |
		CacheFlagGuildStageVoiceChannels

	CacheFlagsAllThreads = CacheFlagGuildNewsThreads |
		CacheFlagGuildPublicThreads |
		CacheFlagGuildPrivateThreads

	CacheFlagsDefault = CacheFlagGuilds |
		CacheFlagsAllChannels |
		CacheFlagRoles |
		CacheFlagEmojis |
		CacheFlagStickers |
		CacheFlagVoiceStates

	CacheFlagsFullRoles = CacheFlagRoles |
		CacheFlagRoleTags

	CacheFlagsAll = CacheFlagGuilds |
		CacheFlagGuildScheduledEvents |
		CacheFlagsAllChannels |
		CacheFlagsFullRoles |
		CacheFlagEmojis |
		CacheFlagStickers |
		CacheFlagVoiceStates |
		CacheFlagStageInstances |
		CacheFlagPresences
)

values for CacheFlags

func (CacheFlags) Add

func (f CacheFlags) Add(bits ...CacheFlags) CacheFlags

Add allows you to add multiple bits together, producing a new bit

func (CacheFlags) Has

func (f CacheFlags) Has(bits ...CacheFlags) bool

Has will ensure that the bit includes all the bits entered

func (CacheFlags) Missing

func (f CacheFlags) Missing(bits ...CacheFlags) bool

Missing will check whether the bit is missing any one of the bits

func (CacheFlags) Remove

func (f CacheFlags) Remove(bits ...CacheFlags) CacheFlags

Remove allows you to subtract multiple bits from the first, producing a new bit

type CacheStrategy

type CacheStrategy func(bot *Bot) bool

CacheStrategy is used to determine whether something should be cached when making an api request. When using the gateway, you'll receive the event shortly afterwards if you have the correct GatewayIntents.

var (
	CacheStrategyYes  CacheStrategy = func(bot *Bot) bool { return true }
	CacheStrategyNo   CacheStrategy = func(bot *Bot) bool { return true }
	CacheStrategyNoWs CacheStrategy = func(bot *Bot) bool { return bot.HasGateway() }
)

Default caches strategy choices

type Caches

type Caches interface {
	Config() CacheConfig

	Users() UserCache
	Roles() RoleCache
	Members() MemberCache
	ThreadMembers() ThreadMemberCache
	Presences() PresenceCache
	VoiceStates() VoiceStateCache
	Messages() MessageCache
	Emojis() EmojiCache
	Stickers() StickerCache
	Guilds() GuildCache
	Channels() ChannelCache
	StageInstances() StageInstanceCache
	GuildScheduledEvents() GuildScheduledEventCache
}

func NewCaches

func NewCaches(config CacheConfig) Caches

type Channel

type Channel interface {
	discord.Channel
	// contains filtered or unexported methods
}

type ChannelCache

type ChannelCache interface {
	Get(channelID discord.Snowflake) Channel
	GetCopy(channelID discord.Snowflake) Channel
	Set(channel Channel) Channel
	Remove(channelID discord.Snowflake)

	Cache() map[discord.Snowflake]Channel
	All() []Channel

	FindFirst(channelFindFunc ChannelFindFunc) Channel
	FindAll(channelFindFunc ChannelFindFunc) []Channel

	ForAll(channelFunc func(channel Channel))
}

func NewChannelCache

func NewChannelCache(cacheFlags CacheFlags) ChannelCache

type ChannelFindFunc

type ChannelFindFunc func(channel Channel) bool

type ChannelFollowerWebhook

type ChannelFollowerWebhook struct {
	discord.ChannelFollowerWebhook
	Bot  *Bot
	User *User
}

func (*ChannelFollowerWebhook) Delete

func (h *ChannelFollowerWebhook) Delete(opts ...rest.RequestOpt) error

func (*ChannelFollowerWebhook) Update

type Collectors

type Collectors interface {
	NewMessageCollector(filter MessageFilter) (<-chan *Message, func())
	NewMessageReactionAddCollector(filter MessageReactionAddFilter) (<-chan *MessageReactionAdd, func())
	NewMessageReactionRemoveCollector(filter MessageReactionRemoveFilter) (<-chan *MessageReactionRemove, func())
	NewInteractionCollector(filter InteractionFilter) (<-chan Interaction, func())
	NewApplicationCommandInteractionCollector(filter ApplicationCommandInteractionFilter) (<-chan ApplicationCommandInteraction, func())
	NewSlashCommandCollector(filter SlashCommandInteractionFilter) (<-chan *SlashCommandInteraction, func())
	NewMessageCommandCollector(filter MessageCommandInteractionFilter) (<-chan *MessageCommandInteraction, func())
	NewUserCommandCollector(filter UserCommandInteractionFilter) (<-chan *UserCommandInteraction, func())
	NewComponentInteractionCollector(filter ComponentInteractionFilter) (<-chan ComponentInteraction, func())
	NewButtonClickCollector(filter ButtonInteractionFilter) (<-chan *ButtonInteraction, func())
	NewSelectMenuSubmitCollector(filter SelectMenuInteractionFilter) (<-chan *SelectMenuInteraction, func())
	NewAutocompleteCollector(filter AutocompleteInteractionFilter) (<-chan *AutocompleteInteraction, func())
}

func NewCollectors

func NewCollectors(bot *Bot, config CollectorsConfig) Collectors

type CollectorsConfig

type CollectorsConfig struct {
	NewMessageCollectorFunc                       func(bot *Bot, filter MessageFilter) (<-chan *Message, func())
	NewMessageReactionAddCollectorFunc            func(bot *Bot, filter MessageReactionAddFilter) (<-chan *MessageReactionAdd, func())
	NewMessageReactionRemoveCollectorFunc         func(bot *Bot, filter MessageReactionRemoveFilter) (<-chan *MessageReactionRemove, func())
	NewInteractionCollectorFunc                   func(bot *Bot, filter InteractionFilter) (<-chan Interaction, func())
	NewApplicationCommandInteractionCollectorFunc func(bot *Bot, filter ApplicationCommandInteractionFilter) (<-chan ApplicationCommandInteraction, func())
	NewSlashCommandCollectorFunc                  func(bot *Bot, filter SlashCommandInteractionFilter) (<-chan *SlashCommandInteraction, func())
	NewMessageCommandCollectorFunc                func(bot *Bot, filter MessageCommandInteractionFilter) (<-chan *MessageCommandInteraction, func())
	NewUserCommandCollectorFunc                   func(bot *Bot, filter UserCommandInteractionFilter) (<-chan *UserCommandInteraction, func())
	NewComponentInteractionCollectorFunc          func(bot *Bot, filter ComponentInteractionFilter) (<-chan ComponentInteraction, func())
	NewButtonClickCollectorFunc                   func(bot *Bot, filter ButtonInteractionFilter) (<-chan *ButtonInteraction, func())
	NewSelectMenuSubmitCollectorFunc              func(bot *Bot, filter SelectMenuInteractionFilter) (<-chan *SelectMenuInteraction, func())
	NewAutocompleteCollectorFunc                  func(bot *Bot, filter AutocompleteInteractionFilter) (<-chan *AutocompleteInteraction, func())
}

type ComponentInteraction

type ComponentInteraction interface {
	discord.ComponentInteraction
}

ComponentInteraction represents a generic discord.Component Interaction received from discord

type ComponentInteractionFilter

type ComponentInteractionFilter func(interaction Interaction) bool

type DMChannel

type DMChannel struct {
	discord.DMChannel
	Bot          *Bot
	RecipientIDs []discord.Snowflake
}

func (*DMChannel) AddReaction

func (c *DMChannel) AddReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*DMChannel) BulkDeleteMessages

func (c *DMChannel) BulkDeleteMessages(messageIDs []discord.Snowflake, opts ...rest.RequestOpt) error

func (*DMChannel) CreateMessage

func (c *DMChannel) CreateMessage(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

func (*DMChannel) Delete

func (c *DMChannel) Delete(opts ...rest.RequestOpt) error

func (*DMChannel) DeleteMessage

func (c *DMChannel) DeleteMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*DMChannel) GetMessage

func (c *DMChannel) GetMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*DMChannel) GetMessages

func (c *DMChannel) GetMessages(around discord.Snowflake, before discord.Snowflake, after discord.Snowflake, limit int, opts ...rest.RequestOpt) ([]*Message, error)

func (*DMChannel) RemoveAllReactions

func (c *DMChannel) RemoveAllReactions(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*DMChannel) RemoveAllReactionsForEmoji

func (c *DMChannel) RemoveAllReactionsForEmoji(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*DMChannel) RemoveOwnReaction

func (c *DMChannel) RemoveOwnReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*DMChannel) RemoveUserReaction

func (c *DMChannel) RemoveUserReaction(messageID discord.Snowflake, emoji string, userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*DMChannel) SendTyping

func (c *DMChannel) SendTyping(opts ...rest.RequestOpt) error

func (*DMChannel) UpdateMessage

func (c *DMChannel) UpdateMessage(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

type Emoji

type Emoji struct {
	discord.Emoji
	Bot *Bot
}

func NewEmoji

func NewEmoji(name string) *Emoji

NewEmoji creates a new emoji with the given unicode

func NewEmote

func NewEmote(name string, emoteID discord.Snowflake, animated bool) *Emoji

NewEmote creates a new custom Emoji with the given parameters

func (*Emoji) Delete

func (e *Emoji) Delete(opts ...rest.RequestOpt) error

func (*Emoji) Guild

func (e *Emoji) Guild() *Guild

Guild returns the Guild of the Emoji from the Caches

func (*Emoji) Reaction

func (e *Emoji) Reaction() string

Reaction returns the identifier used for adding and removing reactions for messages in discord

func (*Emoji) URL

func (e *Emoji) URL(size int) string

func (*Emoji) Update

func (e *Emoji) Update(emojiUpdate discord.EmojiUpdate, opts ...rest.RequestOpt) (*Emoji, error)

type EmojiCache

type EmojiCache interface {
	Get(guildID discord.Snowflake, emojiID discord.Snowflake) *Emoji
	GetCopy(guildID discord.Snowflake, emojiID discord.Snowflake) *Emoji
	Set(emoji *Emoji) *Emoji
	Remove(guildID discord.Snowflake, emojiID discord.Snowflake)

	Cache() map[discord.Snowflake]map[discord.Snowflake]*Emoji
	All() map[discord.Snowflake][]*Emoji

	GuildCache(guildID discord.Snowflake) map[discord.Snowflake]*Emoji
	GuildAll(guildID discord.Snowflake) []*Emoji

	FindFirst(emojiFindFunc EmojiFindFunc) *Emoji
	FindAll(emojiFindFunc EmojiFindFunc) []*Emoji
}

func NewEmojiCache

func NewEmojiCache(cacheFlags CacheFlags) EmojiCache

type EmojiFindFunc

type EmojiFindFunc func(emoji *Emoji) bool

type EntityBuilder

type EntityBuilder interface {
	Bot() *Bot

	CreateInteraction(interaction discord.Interaction, responseChannel chan<- discord.InteractionResponse, updateCache CacheStrategy) Interaction

	CreateUser(user discord.User, updateCache CacheStrategy) *User
	CreateSelfUser(selfUser discord.OAuth2User, updateCache CacheStrategy) *SelfUser
	CreatePresence(presence discord.Presence, updateCache CacheStrategy) *Presence

	CreateMessage(message discord.Message, updateCache CacheStrategy) *Message

	CreateGuild(guild discord.Guild, updateCache CacheStrategy) *Guild
	CreateGuildTemplate(guildTemplate discord.GuildTemplate, updateCache CacheStrategy) *GuildTemplate
	CreateStageInstance(stageInstance discord.StageInstance, updateCache CacheStrategy) *StageInstance

	CreateGuildScheduledEvent(guildScheduledEvent discord.GuildScheduledEvent, updateCache CacheStrategy) *GuildScheduledEvent
	CreateGuildScheduledEventUser(guildID discord.Snowflake, guildScheduledEventUser discord.GuildScheduledEventUser, updateCache CacheStrategy) *GuildScheduledEventUser

	CreateRole(guildID discord.Snowflake, role discord.Role, updateCache CacheStrategy) *Role
	CreateMember(guildID discord.Snowflake, member discord.Member, updateCache CacheStrategy) *Member
	CreateBan(guildID discord.Snowflake, ban discord.Ban, updateCache CacheStrategy) *Ban
	CreateVoiceState(voiceState discord.VoiceState, updateCache CacheStrategy) *VoiceState

	CreateApplicationCommand(applicationCommand discord.ApplicationCommand) ApplicationCommand
	CreateApplicationCommandPermissions(guildCommandPermissions discord.ApplicationCommandPermissions) *ApplicationCommandPermissions

	CreateAuditLog(guildID discord.Snowflake, auditLog discord.AuditLog, filterOptions AuditLogFilterOptions, updateCache CacheStrategy) *AuditLog
	CreateIntegration(guildID discord.Snowflake, integration discord.Integration, updateCache CacheStrategy) Integration

	CreateChannel(channel discord.Channel, updateCache CacheStrategy) Channel
	CreateThreadMember(threadMember discord.ThreadMember, updateCache CacheStrategy) *ThreadMember

	CreateInvite(invite discord.Invite, updateCache CacheStrategy) *Invite

	CreateEmoji(guildID discord.Snowflake, emoji discord.Emoji, updateCache CacheStrategy) *Emoji
	CreateStickerPack(stickerPack discord.StickerPack, updateCache CacheStrategy) *StickerPack
	CreateSticker(sticker discord.Sticker, updateCache CacheStrategy) *Sticker
	CreateMessageSticker(sticker discord.MessageSticker) *MessageSticker

	CreateWebhook(webhook discord.Webhook, updateCache CacheStrategy) Webhook
}

EntityBuilder is used to create structs for disgo's caches

func NewEntityBuilder

func NewEntityBuilder(bot *Bot) EntityBuilder

type Event

type Event interface {
	Bot() *Bot
	SequenceNumber() int
}

Event the basic interface each event implement

type EventListener

type EventListener interface {
	OnEvent(event Event)
}

EventListener is used to create new EventListener to listen to events

type EventManager

type EventManager interface {
	Bot() *Bot
	Config() EventManagerConfig

	AddEventListeners(eventListeners ...EventListener)
	RemoveEventListeners(eventListeners ...EventListener)
	HandleGateway(gatewayEventType discord.GatewayEventType, sequenceNumber int, payload io.Reader)
	HandleHTTP(responseChannel chan<- discord.InteractionResponse, payload io.Reader)
	Dispatch(event Event)
}

EventManager lets you listen for specific events triggered by raw gateway events

func NewEventManager

func NewEventManager(bot *Bot, config *EventManagerConfig) EventManager

type EventManagerConfig

type EventManagerConfig struct {
	EventListeners     []EventListener
	RawEventsEnabled   bool
	AsyncEventsEnabled bool

	GatewayHandlers   map[discord.GatewayEventType]GatewayEventHandler
	HTTPServerHandler HTTPServerEventHandler
}

type GatewayEventHandler

type GatewayEventHandler interface {
	EventType() discord.GatewayEventType
	New() interface{}
	HandleGatewayEvent(bot *Bot, sequenceNumber int, v interface{})
}

GatewayEventHandler is used to handle Gateway Event(s)

type GroupDMChannel

type GroupDMChannel struct {
	discord.GroupDMChannel
	Bot          *Bot
	RecipientIDs []discord.Snowflake
}

func (*GroupDMChannel) Delete

func (c *GroupDMChannel) Delete(opts ...rest.RequestOpt) error

func (*GroupDMChannel) GetIconURL

func (c *GroupDMChannel) GetIconURL(size int) *string

GetIconURL returns the Icon URL of this channel.

func (*GroupDMChannel) Update

func (c *GroupDMChannel) Update(channelUpdate discord.GroupDMChannelUpdate, opts ...rest.RequestOpt) (*GroupDMChannel, error)

type Guild

type Guild struct {
	discord.Guild
	Bot *Bot
}

func (*Guild) AddMember

func (g *Guild) AddMember(userID discord.Snowflake, memberAdd discord.MemberAdd, opts ...rest.RequestOpt) (*Member, error)

AddMember adds a member to the Guild with the oauth2 access token

func (*Guild) BanMember

func (g *Guild) BanMember(userID discord.Snowflake, deleteMessageDays int, opts ...rest.RequestOpt) error

BanMember bans a Member from the Guild

func (*Guild) CreateEmoji

func (g *Guild) CreateEmoji(emojiCreate discord.EmojiCreate, opts ...rest.RequestOpt) (*Emoji, error)

CreateEmoji creates a new Emoji with the properties provided in discord.EmojiCreate

func (*Guild) CreateGuildCommand

func (g *Guild) CreateGuildCommand(commandCreate discord.ApplicationCommandCreate, opts ...rest.RequestOpt) (ApplicationCommand, error)

CreateGuildCommand creates a new Guild discord.ApplicationCommand

func (*Guild) CreateGuildScheduledEvent added in v0.6.1

func (g *Guild) CreateGuildScheduledEvent(guildScheduledEventCreate discord.GuildScheduledEventCreate, opts ...rest.RequestOpt) (*GuildScheduledEvent, error)

func (*Guild) CreateRole

func (g *Guild) CreateRole(roleCreate discord.RoleCreate, opts ...rest.RequestOpt) (*Role, error)

CreateRole creates a new Role with the properties provided in discord.RoleCreate

func (*Guild) CreateSticker

func (g *Guild) CreateSticker(stickerCreate discord.StickerCreate, opts ...rest.RequestOpt) (*Sticker, error)

CreateSticker creates a new Sticker with the properties provided in discord.StickerCreate

func (*Guild) CreateTemplate

func (g *Guild) CreateTemplate(guildTemplateCreate discord.GuildTemplateCreate, opts ...rest.RequestOpt) (*GuildTemplate, error)

CreateTemplate creates a new GuildTemplate

func (*Guild) Delete

func (g *Guild) Delete(opts ...rest.RequestOpt) error

Delete deletes the this Guild

func (*Guild) DeleteEmoji

func (g *Guild) DeleteEmoji(emojiID discord.Snowflake, opts ...rest.RequestOpt) error

DeleteEmoji deletes an Emoji

func (*Guild) DeleteGuildCommand

func (g *Guild) DeleteGuildCommand(commandID discord.Snowflake, opts ...rest.RequestOpt) error

DeleteGuildCommand creates a new Guild discord.ApplicationCommand

func (*Guild) DeleteGuildScheduledEvent added in v0.6.1

func (g *Guild) DeleteGuildScheduledEvent(guildScheduledEventID discord.Snowflake, opts ...rest.RequestOpt) error

func (*Guild) DeleteIntegration

func (g *Guild) DeleteIntegration(integrationID discord.Snowflake, opts ...rest.RequestOpt) error

DeleteIntegration deletes a specific Integration from the Guild. Requires PermissionManageServer

func (*Guild) DeleteRole

func (g *Guild) DeleteRole(roleID discord.Snowflake, opts ...rest.RequestOpt) error

DeleteRole deletes a Role

func (*Guild) DeleteSticker

func (g *Guild) DeleteSticker(stickerID discord.Snowflake, opts ...rest.RequestOpt) error

DeleteSticker deletes a Sticker

func (*Guild) DeleteTemplate

func (g *Guild) DeleteTemplate(templateCode string, opts ...rest.RequestOpt) (*GuildTemplate, error)

DeleteTemplate deletes a specific GuildTemplate

func (*Guild) Disconnect

func (g *Guild) Disconnect(ctx context.Context) error

Disconnect sends a GatewayCommand to disconnect from this Guild

func (*Guild) GetAuditLogs

func (g *Guild) GetAuditLogs(filterOptions AuditLogFilterOptions, opts ...rest.RequestOpt) (*AuditLog, error)

GetAuditLogs gets AuditLog(s) for this Guild

func (*Guild) GetBan

func (g *Guild) GetBan(userID discord.Snowflake, opts ...rest.RequestOpt) (*Ban, error)

GetBan fetches a ban for a User for this Guild

func (*Guild) GetBans

func (g *Guild) GetBans(opts ...rest.RequestOpt) ([]*Ban, error)

GetBans fetches all bans for this Guild

func (*Guild) GetGuildCommand

func (g *Guild) GetGuildCommand(commandID discord.Snowflake, opts ...rest.RequestOpt) (ApplicationCommand, error)

GetGuildCommand fetches a specific Guild discord.ApplicationCommand

func (*Guild) GetGuildCommandPermissions

func (g *Guild) GetGuildCommandPermissions(commandID discord.Snowflake, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error)

GetGuildCommandPermissions returns the core.ApplicationCommandPermissions for a specific discord.ApplicationCommand in an core.Guild

func (*Guild) GetGuildCommands

func (g *Guild) GetGuildCommands(opts ...rest.RequestOpt) ([]ApplicationCommand, error)

GetGuildCommands fetches all Guild discord.ApplicationCommand(s)

func (*Guild) GetGuildCommandsPermissions

func (g *Guild) GetGuildCommandsPermissions(opts ...rest.RequestOpt) ([]*ApplicationCommandPermissions, error)

GetGuildCommandsPermissions returns the core.ApplicationCommandPermissions for a all discord.ApplicationCommand(s) in an core.Guild

func (*Guild) GetGuildScheduledEventUsers added in v0.6.1

func (g *Guild) GetGuildScheduledEventUsers(guildScheduledEventID discord.Snowflake, limit int, withMember bool, before discord.Snowflake, after discord.Snowflake, opts ...rest.RequestOpt) ([]*GuildScheduledEventUser, error)

func (*Guild) GetIntegrations

func (g *Guild) GetIntegrations(opts ...rest.RequestOpt) ([]Integration, error)

GetIntegrations gets all Integration(s) from the Guild. Requires PermissionManageServer

func (*Guild) GetMember

func (g *Guild) GetMember(userID discord.Snowflake) *Member

GetMember returns the specific Member for this Guild

func (*Guild) GetTemplates

func (g *Guild) GetTemplates(opts ...rest.RequestOpt) ([]*GuildTemplate, error)

GetTemplates gets a specific GuildTemplate

func (*Guild) IconURL

func (g *Guild) IconURL(size int) *string

IconURL returns the Icon of a Guild

func (*Guild) KickMember

func (g *Guild) KickMember(userID discord.Snowflake, opts ...rest.RequestOpt) error

KickMember kicks an existing member from the Guild

func (*Guild) Leave

func (g *Guild) Leave(opts ...rest.RequestOpt) error

Leave leaves this Guild

func (*Guild) PublicRole

func (g *Guild) PublicRole() *Role

PublicRole returns the @everyone Role

func (*Guild) RequestMembers

func (g *Guild) RequestMembers(userIDs ...discord.Snowflake) ([]*Member, error)

func (*Guild) RequestMembersChan

func (g *Guild) RequestMembersChan(userIDs []discord.Snowflake) (<-chan *Member, func(), error)

func (*Guild) RequestMembersCtx

func (g *Guild) RequestMembersCtx(ctx context.Context, userIDs ...discord.Snowflake) ([]*Member, error)

func (*Guild) RequestMembersWithFilter

func (g *Guild) RequestMembersWithFilter(memberFilterFunc func(member *Member) bool) ([]*Member, error)

func (*Guild) RequestMembersWithFilterChan

func (g *Guild) RequestMembersWithFilterChan(memberFilterFunc func(member *Member) bool) (<-chan *Member, func(), error)

func (*Guild) RequestMembersWithFilterCtx

func (g *Guild) RequestMembersWithFilterCtx(ctx context.Context, memberFilterFunc func(member *Member) bool) ([]*Member, error)

func (*Guild) RequestMembersWithQuery

func (g *Guild) RequestMembersWithQuery(query string, limit int) ([]*Member, error)

func (*Guild) RequestMembersWithQueryChan

func (g *Guild) RequestMembersWithQueryChan(query string, limit int) (<-chan *Member, func(), error)

func (*Guild) RequestMembersWithQueryCtx

func (g *Guild) RequestMembersWithQueryCtx(ctx context.Context, query string, limit int) ([]*Member, error)

func (*Guild) RoleCache

func (g *Guild) RoleCache() map[discord.Snowflake]*Role

RoleCache returns all Role(s) in this Guild

func (*Guild) Roles

func (g *Guild) Roles() []*Role

Roles returns all Role(s) in this Guild

func (*Guild) SelfMember

func (g *Guild) SelfMember() *Member

SelfMember returns the Member for the current logged-in User for this Guild

func (*Guild) SetGuildCommandPermissions

func (g *Guild) SetGuildCommandPermissions(commandID discord.Snowflake, permissions []discord.ApplicationCommandPermission, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error)

SetGuildCommandPermissions sets the core.ApplicationCommandPermissions for a specific discord.ApplicationCommand

func (*Guild) SetGuildCommands

func (g *Guild) SetGuildCommands(commandCreates []discord.ApplicationCommandCreate, opts ...rest.RequestOpt) ([]ApplicationCommand, error)

SetGuildCommands overrides all Guild discord.ApplicationCommand(s)

func (*Guild) SetGuildCommandsPermissions

func (g *Guild) SetGuildCommandsPermissions(commandPermissions []discord.ApplicationCommandPermissionsSet, opts ...rest.RequestOpt) ([]*ApplicationCommandPermissions, error)

SetGuildCommandsPermissions sets the discord.ApplicationCommandPermissions for all discord.ApplicationCommand(s)

func (*Guild) SyncTemplate

func (g *Guild) SyncTemplate(templateCode string, opts ...rest.RequestOpt) (*GuildTemplate, error)

SyncTemplate syncs the current Guild status to an existing GuildTemplate

func (*Guild) UnbanMember

func (g *Guild) UnbanMember(userID discord.Snowflake, opts ...rest.RequestOpt) error

UnbanMember unbans a Member from the Guild

func (*Guild) Update

func (g *Guild) Update(updateGuild discord.GuildUpdate, opts ...rest.RequestOpt) (*Guild, error)

Update updates the this Guild

func (*Guild) UpdateEmoji

func (g *Guild) UpdateEmoji(emojiID discord.Snowflake, emojiUpdate discord.EmojiUpdate, opts ...rest.RequestOpt) (*Emoji, error)

UpdateEmoji creates an Emoji with the properties provided in discord.EmojiUpdate

func (*Guild) UpdateGuildCommand

func (g *Guild) UpdateGuildCommand(commandID discord.Snowflake, commandUpdate discord.ApplicationCommandUpdate, opts ...rest.RequestOpt) (ApplicationCommand, error)

UpdateGuildCommand edits a specific Guild discord.ApplicationCommand

func (*Guild) UpdateGuildScheduledEvent added in v0.6.1

func (g *Guild) UpdateGuildScheduledEvent(guildScheduledEventID discord.Snowflake, guildScheduledEventUpdate discord.GuildScheduledEventUpdate, opts ...rest.RequestOpt) (*GuildScheduledEvent, error)

func (*Guild) UpdateMember

func (g *Guild) UpdateMember(userID discord.Snowflake, memberUpdate discord.MemberUpdate, opts ...rest.RequestOpt) (*Member, error)

UpdateMember updates an existing member of the Guild

func (*Guild) UpdateRole

func (g *Guild) UpdateRole(roleID discord.Snowflake, roleUpdate discord.RoleUpdate, opts ...rest.RequestOpt) (*Role, error)

UpdateRole updates a Role with the properties provided in discord.RoleUpdate

func (*Guild) UpdateSticker

func (g *Guild) UpdateSticker(stickerID discord.Snowflake, stickerUpdate discord.StickerUpdate, opts ...rest.RequestOpt) (*Sticker, error)

UpdateSticker updates a Sticker with the properties provided in discord.StickerCreate

func (*Guild) UpdateTemplate

func (g *Guild) UpdateTemplate(templateCode string, guildTemplateUpdate discord.GuildTemplateUpdate, opts ...rest.RequestOpt) (*GuildTemplate, error)

UpdateTemplate updates a specific GuildTemplate

type GuildAudioChannel

type GuildAudioChannel interface {
	discord.GuildAudioChannel
	GuildChannel

	Connect(ctx context.Context) error
	// contains filtered or unexported methods
}

type GuildCache

type GuildCache interface {
	rwsync.RWLocker

	Get(guildID discord.Snowflake) *Guild
	GetCopy(guildID discord.Snowflake) *Guild
	Set(guild *Guild) *Guild
	Remove(guildID discord.Snowflake)

	Cache() map[discord.Snowflake]*Guild
	All() []*Guild

	FindFirst(guildFindFunc GuildFindFunc) *Guild
	FindAll(guildFindFunc GuildFindFunc) []*Guild

	SetReady(shardID int, guildID discord.Snowflake)
	SetUnready(shardID int, guildID discord.Snowflake)
	IsUnready(shardID int, guildID discord.Snowflake) bool
	UnreadyGuilds(shardID int) []discord.Snowflake

	SetUnavailable(guildID discord.Snowflake)
	SetAvailable(guildID discord.Snowflake)
	IsUnavailable(guildID discord.Snowflake) bool
	UnavailableGuilds() []discord.Snowflake
}

func NewGuildCache

func NewGuildCache(cacheFlags CacheFlags) GuildCache

type GuildCategoryChannel

type GuildCategoryChannel struct {
	discord.GuildCategoryChannel
	Bot *Bot
}

func (*GuildCategoryChannel) Channels

func (c *GuildCategoryChannel) Channels() []GuildChannel

func (*GuildCategoryChannel) Delete

func (c *GuildCategoryChannel) Delete(opts ...rest.RequestOpt) error

func (*GuildCategoryChannel) DeletePermissionOverwrite

func (c *GuildCategoryChannel) DeletePermissionOverwrite(id discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildCategoryChannel) Guild

func (c *GuildCategoryChannel) Guild() *Guild

func (*GuildCategoryChannel) MemberPermissionOverwrite

func (c *GuildCategoryChannel) MemberPermissionOverwrite(id discord.Snowflake) *discord.MemberPermissionOverwrite

func (*GuildCategoryChannel) Members

func (c *GuildCategoryChannel) Members() []*Member

func (*GuildCategoryChannel) PermissionOverwrite

func (*GuildCategoryChannel) PermissionOverwrites

func (c *GuildCategoryChannel) PermissionOverwrites() []discord.PermissionOverwrite

func (*GuildCategoryChannel) RolePermissionOverwrite

func (c *GuildCategoryChannel) RolePermissionOverwrite(id discord.Snowflake) *discord.RolePermissionOverwrite

func (*GuildCategoryChannel) SetPermissionOverwrite

func (c *GuildCategoryChannel) SetPermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

func (*GuildCategoryChannel) Update

Update updates the GuildNewsChannel which can return either a GuildNewsChannel or a GuildTextChannel

func (*GuildCategoryChannel) UpdateGuildChannel

func (c *GuildCategoryChannel) UpdateGuildChannel(guildChannelUpdate discord.GuildChannelUpdate, opts ...rest.RequestOpt) (GuildChannel, error)

func (*GuildCategoryChannel) UpdatePermissionOverwrite

func (c *GuildCategoryChannel) UpdatePermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

type GuildChannel

type GuildChannel interface {
	discord.GuildChannel
	Channel
	Guild() *Guild

	UpdateGuildChannel(guildChannelUpdate discord.GuildChannelUpdate, opts ...rest.RequestOpt) (GuildChannel, error)
	Delete(opts ...rest.RequestOpt) error

	PermissionOverwrites() []discord.PermissionOverwrite
	PermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake) discord.PermissionOverwrite
	RolePermissionOverwrite(id discord.Snowflake) *discord.RolePermissionOverwrite
	MemberPermissionOverwrite(id discord.Snowflake) *discord.MemberPermissionOverwrite
	SetPermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error
	UpdatePermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error
	DeletePermissionOverwrite(id discord.Snowflake, opts ...rest.RequestOpt) error

	Members() []*Member
}

type GuildFindFunc

type GuildFindFunc func(guild *Guild) bool

type GuildMessageChannel

type GuildMessageChannel interface {
	discord.GuildMessageChannel
	BaseGuildMessageChannel

	GetWebhooks(opts ...rest.RequestOpt) ([]Webhook, error)
	CreateWebhook(webhookCreate discord.WebhookCreate, opts ...rest.RequestOpt) (Webhook, error)
	DeleteWebhook(webhookID discord.Snowflake, opts ...rest.RequestOpt) error

	Threads() []GuildThread
	Thread(threadID discord.Snowflake) GuildThread

	CreateThread(theadCreate discord.ThreadCreate, opts ...rest.RequestOpt) (GuildThread, error)
	CreateThreadWithMessage(messageID discord.Snowflake, threadCreateWithMessage discord.ThreadCreateWithMessage, opts ...rest.RequestOpt) (GuildThread, error)

	GetPublicArchivedThreads(before discord.Time, limit int, opts ...rest.RequestOpt) ([]GuildThread, map[discord.Snowflake]*ThreadMember, bool, error)
}

type GuildNewsChannel

type GuildNewsChannel struct {
	discord.GuildNewsChannel
	Bot *Bot
}

func (*GuildNewsChannel) AddReaction

func (c *GuildNewsChannel) AddReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildNewsChannel) BulkDeleteMessages

func (c *GuildNewsChannel) BulkDeleteMessages(messageIDs []discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsChannel) CreateMessage

func (c *GuildNewsChannel) CreateMessage(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

func (*GuildNewsChannel) CreateThread

func (c *GuildNewsChannel) CreateThread(theadCreate discord.ThreadCreate, opts ...rest.RequestOpt) (GuildThread, error)

func (*GuildNewsChannel) CreateThreadWithMessage

func (c *GuildNewsChannel) CreateThreadWithMessage(messageID discord.Snowflake, threadCreateWithMessage discord.ThreadCreateWithMessage, opts ...rest.RequestOpt) (GuildThread, error)

func (*GuildNewsChannel) CreateWebhook

func (c *GuildNewsChannel) CreateWebhook(webhookCreate discord.WebhookCreate, opts ...rest.RequestOpt) (Webhook, error)

func (*GuildNewsChannel) CrosspostMessage

func (c *GuildNewsChannel) CrosspostMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*GuildNewsChannel) Delete

func (c *GuildNewsChannel) Delete(opts ...rest.RequestOpt) error

func (*GuildNewsChannel) DeleteMessage

func (c *GuildNewsChannel) DeleteMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsChannel) DeletePermissionOverwrite

func (c *GuildNewsChannel) DeletePermissionOverwrite(id discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsChannel) DeleteWebhook

func (c *GuildNewsChannel) DeleteWebhook(webhookID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsChannel) GetMessage

func (c *GuildNewsChannel) GetMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*GuildNewsChannel) GetMessages

func (c *GuildNewsChannel) GetMessages(around discord.Snowflake, before discord.Snowflake, after discord.Snowflake, limit int, opts ...rest.RequestOpt) ([]*Message, error)

func (*GuildNewsChannel) GetPublicArchivedThreads

func (c *GuildNewsChannel) GetPublicArchivedThreads(before discord.Time, limit int, opts ...rest.RequestOpt) ([]GuildThread, map[discord.Snowflake]*ThreadMember, bool, error)

func (*GuildNewsChannel) GetWebhooks

func (c *GuildNewsChannel) GetWebhooks(opts ...rest.RequestOpt) ([]Webhook, error)

func (*GuildNewsChannel) Guild

func (c *GuildNewsChannel) Guild() *Guild

func (*GuildNewsChannel) MemberPermissionOverwrite

func (c *GuildNewsChannel) MemberPermissionOverwrite(id discord.Snowflake) *discord.MemberPermissionOverwrite

func (*GuildNewsChannel) Members

func (c *GuildNewsChannel) Members() []*Member

func (*GuildNewsChannel) NewsThreads

func (c *GuildNewsChannel) NewsThreads() []*GuildNewsThread

func (*GuildNewsChannel) Parent

func (*GuildNewsChannel) PermissionOverwrite

func (*GuildNewsChannel) PermissionOverwrites

func (c *GuildNewsChannel) PermissionOverwrites() []discord.PermissionOverwrite

func (*GuildNewsChannel) PrivateThreads

func (c *GuildNewsChannel) PrivateThreads() []*GuildPrivateThread

func (*GuildNewsChannel) PublicThreads

func (c *GuildNewsChannel) PublicThreads() []*GuildPublicThread

func (*GuildNewsChannel) RemoveAllReactions

func (c *GuildNewsChannel) RemoveAllReactions(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsChannel) RemoveAllReactionsForEmoji

func (c *GuildNewsChannel) RemoveAllReactionsForEmoji(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildNewsChannel) RemoveOwnReaction

func (c *GuildNewsChannel) RemoveOwnReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildNewsChannel) RemoveUserReaction

func (c *GuildNewsChannel) RemoveUserReaction(messageID discord.Snowflake, emoji string, userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsChannel) RolePermissionOverwrite

func (c *GuildNewsChannel) RolePermissionOverwrite(id discord.Snowflake) *discord.RolePermissionOverwrite

func (*GuildNewsChannel) SendTyping

func (c *GuildNewsChannel) SendTyping(opts ...rest.RequestOpt) error

func (*GuildNewsChannel) SetPermissionOverwrite

func (c *GuildNewsChannel) SetPermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

func (*GuildNewsChannel) Thread

func (c *GuildNewsChannel) Thread(threadID discord.Snowflake) GuildThread

func (*GuildNewsChannel) Threads

func (c *GuildNewsChannel) Threads() []GuildThread

func (*GuildNewsChannel) Update

Update updates the GuildNewsChannel which can return either a GuildNewsChannel or a GuildTextChannel

func (*GuildNewsChannel) UpdateGuildChannel

func (c *GuildNewsChannel) UpdateGuildChannel(guildChannelUpdate discord.GuildChannelUpdate, opts ...rest.RequestOpt) (GuildChannel, error)

func (*GuildNewsChannel) UpdateMessage

func (c *GuildNewsChannel) UpdateMessage(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

func (*GuildNewsChannel) UpdatePermissionOverwrite

func (c *GuildNewsChannel) UpdatePermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

type GuildNewsThread

type GuildNewsThread struct {
	discord.GuildNewsThread
	Bot *Bot
}

func (*GuildNewsThread) AddReaction

func (c *GuildNewsThread) AddReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildNewsThread) AddThreadMember

func (c *GuildNewsThread) AddThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsThread) BulkDeleteMessages

func (c *GuildNewsThread) BulkDeleteMessages(messageIDs []discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsThread) CreateMessage

func (c *GuildNewsThread) CreateMessage(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

func (*GuildNewsThread) Delete

func (c *GuildNewsThread) Delete(opts ...rest.RequestOpt) error

func (*GuildNewsThread) DeleteMessage

func (c *GuildNewsThread) DeleteMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsThread) DeletePermissionOverwrite

func (c *GuildNewsThread) DeletePermissionOverwrite(id discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsThread) GetMessage

func (c *GuildNewsThread) GetMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*GuildNewsThread) GetMessages

func (c *GuildNewsThread) GetMessages(around discord.Snowflake, before discord.Snowflake, after discord.Snowflake, limit int, opts ...rest.RequestOpt) ([]*Message, error)

func (*GuildNewsThread) GetThreadMember

func (c *GuildNewsThread) GetThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) (*ThreadMember, error)

func (*GuildNewsThread) GetThreadMembers

func (c *GuildNewsThread) GetThreadMembers(opts ...rest.RequestOpt) ([]*ThreadMember, error)

func (*GuildNewsThread) Guild

func (c *GuildNewsThread) Guild() *Guild

func (*GuildNewsThread) Join

func (c *GuildNewsThread) Join(opts ...rest.RequestOpt) error

func (*GuildNewsThread) Leave

func (c *GuildNewsThread) Leave(opts ...rest.RequestOpt) error

func (*GuildNewsThread) MemberPermissionOverwrite

func (c *GuildNewsThread) MemberPermissionOverwrite(id discord.Snowflake) *discord.MemberPermissionOverwrite

func (*GuildNewsThread) Members

func (c *GuildNewsThread) Members() []*Member

func (*GuildNewsThread) Parent

func (c *GuildNewsThread) Parent() *GuildNewsChannel

func (*GuildNewsThread) ParentMessageChannel

func (c *GuildNewsThread) ParentMessageChannel() GuildMessageChannel

func (*GuildNewsThread) PermissionOverwrite

func (*GuildNewsThread) PermissionOverwrites

func (c *GuildNewsThread) PermissionOverwrites() []discord.PermissionOverwrite

func (*GuildNewsThread) RemoveAllReactions

func (c *GuildNewsThread) RemoveAllReactions(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsThread) RemoveAllReactionsForEmoji

func (c *GuildNewsThread) RemoveAllReactionsForEmoji(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildNewsThread) RemoveOwnReaction

func (c *GuildNewsThread) RemoveOwnReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildNewsThread) RemoveThreadMember

func (c *GuildNewsThread) RemoveThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsThread) RemoveUserReaction

func (c *GuildNewsThread) RemoveUserReaction(messageID discord.Snowflake, emoji string, userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildNewsThread) RolePermissionOverwrite

func (c *GuildNewsThread) RolePermissionOverwrite(id discord.Snowflake) *discord.RolePermissionOverwrite

func (*GuildNewsThread) SelfThreadMember

func (c *GuildNewsThread) SelfThreadMember() *ThreadMember

func (*GuildNewsThread) SendTyping

func (c *GuildNewsThread) SendTyping(opts ...rest.RequestOpt) error

func (*GuildNewsThread) SetPermissionOverwrite

func (c *GuildNewsThread) SetPermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

func (*GuildNewsThread) ThreadMember

func (c *GuildNewsThread) ThreadMember(userID discord.Snowflake) *ThreadMember

func (*GuildNewsThread) ThreadMembers

func (c *GuildNewsThread) ThreadMembers() []*ThreadMember

func (*GuildNewsThread) Update

func (c *GuildNewsThread) Update(channelUpdate discord.GuildNewsThreadUpdate, opts ...rest.RequestOpt) (*GuildNewsThread, error)

func (*GuildNewsThread) UpdateGuildChannel

func (c *GuildNewsThread) UpdateGuildChannel(guildChannelUpdate discord.GuildChannelUpdate, opts ...rest.RequestOpt) (GuildChannel, error)

func (*GuildNewsThread) UpdateMessage

func (c *GuildNewsThread) UpdateMessage(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

func (*GuildNewsThread) UpdatePermissionOverwrite

func (c *GuildNewsThread) UpdatePermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

type GuildPrivateThread

type GuildPrivateThread struct {
	discord.GuildPrivateThread
	Bot *Bot
}

func (*GuildPrivateThread) AddReaction

func (c *GuildPrivateThread) AddReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildPrivateThread) AddThreadMember

func (c *GuildPrivateThread) AddThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPrivateThread) BulkDeleteMessages

func (c *GuildPrivateThread) BulkDeleteMessages(messageIDs []discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPrivateThread) CreateMessage

func (c *GuildPrivateThread) CreateMessage(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

func (*GuildPrivateThread) Delete

func (c *GuildPrivateThread) Delete(opts ...rest.RequestOpt) error

func (*GuildPrivateThread) DeleteMessage

func (c *GuildPrivateThread) DeleteMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPrivateThread) DeletePermissionOverwrite

func (c *GuildPrivateThread) DeletePermissionOverwrite(id discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPrivateThread) GetMessage

func (c *GuildPrivateThread) GetMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*GuildPrivateThread) GetMessages

func (c *GuildPrivateThread) GetMessages(around discord.Snowflake, before discord.Snowflake, after discord.Snowflake, limit int, opts ...rest.RequestOpt) ([]*Message, error)

func (*GuildPrivateThread) GetThreadMember

func (c *GuildPrivateThread) GetThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) (*ThreadMember, error)

func (*GuildPrivateThread) GetThreadMembers

func (c *GuildPrivateThread) GetThreadMembers(opts ...rest.RequestOpt) ([]*ThreadMember, error)

func (*GuildPrivateThread) Guild

func (c *GuildPrivateThread) Guild() *Guild

func (*GuildPrivateThread) Join

func (c *GuildPrivateThread) Join(opts ...rest.RequestOpt) error

func (*GuildPrivateThread) Leave

func (c *GuildPrivateThread) Leave(opts ...rest.RequestOpt) error

func (*GuildPrivateThread) MemberPermissionOverwrite

func (c *GuildPrivateThread) MemberPermissionOverwrite(id discord.Snowflake) *discord.MemberPermissionOverwrite

func (*GuildPrivateThread) Members

func (c *GuildPrivateThread) Members() []*Member

func (*GuildPrivateThread) Parent

func (c *GuildPrivateThread) Parent() *GuildTextChannel

func (*GuildPrivateThread) ParentMessageChannel

func (c *GuildPrivateThread) ParentMessageChannel() GuildMessageChannel

func (*GuildPrivateThread) PermissionOverwrite

func (*GuildPrivateThread) PermissionOverwrites

func (c *GuildPrivateThread) PermissionOverwrites() []discord.PermissionOverwrite

func (*GuildPrivateThread) RemoveAllReactions

func (c *GuildPrivateThread) RemoveAllReactions(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPrivateThread) RemoveAllReactionsForEmoji

func (c *GuildPrivateThread) RemoveAllReactionsForEmoji(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildPrivateThread) RemoveOwnReaction

func (c *GuildPrivateThread) RemoveOwnReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildPrivateThread) RemoveThreadMember

func (c *GuildPrivateThread) RemoveThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPrivateThread) RemoveUserReaction

func (c *GuildPrivateThread) RemoveUserReaction(messageID discord.Snowflake, emoji string, userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPrivateThread) RolePermissionOverwrite

func (c *GuildPrivateThread) RolePermissionOverwrite(id discord.Snowflake) *discord.RolePermissionOverwrite

func (*GuildPrivateThread) SelfThreadMember

func (c *GuildPrivateThread) SelfThreadMember() *ThreadMember

func (*GuildPrivateThread) SendTyping

func (c *GuildPrivateThread) SendTyping(opts ...rest.RequestOpt) error

func (*GuildPrivateThread) SetPermissionOverwrite

func (c *GuildPrivateThread) SetPermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

func (*GuildPrivateThread) ThreadMember

func (c *GuildPrivateThread) ThreadMember(userID discord.Snowflake) *ThreadMember

func (*GuildPrivateThread) ThreadMembers

func (c *GuildPrivateThread) ThreadMembers() []*ThreadMember

func (*GuildPrivateThread) Update

func (*GuildPrivateThread) UpdateGuildChannel

func (c *GuildPrivateThread) UpdateGuildChannel(guildChannelUpdate discord.GuildChannelUpdate, opts ...rest.RequestOpt) (GuildChannel, error)

func (*GuildPrivateThread) UpdateMessage

func (c *GuildPrivateThread) UpdateMessage(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

func (*GuildPrivateThread) UpdatePermissionOverwrite

func (c *GuildPrivateThread) UpdatePermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

type GuildPublicThread

type GuildPublicThread struct {
	discord.GuildPublicThread
	Bot *Bot
}

func (*GuildPublicThread) AddReaction

func (c *GuildPublicThread) AddReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildPublicThread) AddThreadMember

func (c *GuildPublicThread) AddThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPublicThread) BulkDeleteMessages

func (c *GuildPublicThread) BulkDeleteMessages(messageIDs []discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPublicThread) CreateMessage

func (c *GuildPublicThread) CreateMessage(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

func (*GuildPublicThread) Delete

func (c *GuildPublicThread) Delete(opts ...rest.RequestOpt) error

func (*GuildPublicThread) DeleteMessage

func (c *GuildPublicThread) DeleteMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPublicThread) DeletePermissionOverwrite

func (c *GuildPublicThread) DeletePermissionOverwrite(id discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPublicThread) GetMessage

func (c *GuildPublicThread) GetMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*GuildPublicThread) GetMessages

func (c *GuildPublicThread) GetMessages(around discord.Snowflake, before discord.Snowflake, after discord.Snowflake, limit int, opts ...rest.RequestOpt) ([]*Message, error)

func (*GuildPublicThread) GetThreadMember

func (c *GuildPublicThread) GetThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) (*ThreadMember, error)

func (*GuildPublicThread) GetThreadMembers

func (c *GuildPublicThread) GetThreadMembers(opts ...rest.RequestOpt) ([]*ThreadMember, error)

func (*GuildPublicThread) Guild

func (c *GuildPublicThread) Guild() *Guild

func (*GuildPublicThread) Join

func (c *GuildPublicThread) Join(opts ...rest.RequestOpt) error

func (*GuildPublicThread) Leave

func (c *GuildPublicThread) Leave(opts ...rest.RequestOpt) error

func (*GuildPublicThread) MemberPermissionOverwrite

func (c *GuildPublicThread) MemberPermissionOverwrite(id discord.Snowflake) *discord.MemberPermissionOverwrite

func (*GuildPublicThread) Members

func (c *GuildPublicThread) Members() []*Member

func (*GuildPublicThread) Parent

func (c *GuildPublicThread) Parent() *GuildTextChannel

func (*GuildPublicThread) ParentMessageChannel

func (c *GuildPublicThread) ParentMessageChannel() GuildMessageChannel

func (*GuildPublicThread) PermissionOverwrite

func (*GuildPublicThread) PermissionOverwrites

func (c *GuildPublicThread) PermissionOverwrites() []discord.PermissionOverwrite

func (*GuildPublicThread) RemoveAllReactions

func (c *GuildPublicThread) RemoveAllReactions(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPublicThread) RemoveAllReactionsForEmoji

func (c *GuildPublicThread) RemoveAllReactionsForEmoji(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildPublicThread) RemoveOwnReaction

func (c *GuildPublicThread) RemoveOwnReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildPublicThread) RemoveThreadMember

func (c *GuildPublicThread) RemoveThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPublicThread) RemoveUserReaction

func (c *GuildPublicThread) RemoveUserReaction(messageID discord.Snowflake, emoji string, userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildPublicThread) RolePermissionOverwrite

func (c *GuildPublicThread) RolePermissionOverwrite(id discord.Snowflake) *discord.RolePermissionOverwrite

func (*GuildPublicThread) SelfThreadMember

func (c *GuildPublicThread) SelfThreadMember() *ThreadMember

func (*GuildPublicThread) SendTyping

func (c *GuildPublicThread) SendTyping(opts ...rest.RequestOpt) error

func (*GuildPublicThread) SetPermissionOverwrite

func (c *GuildPublicThread) SetPermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

func (*GuildPublicThread) ThreadMember

func (c *GuildPublicThread) ThreadMember(userID discord.Snowflake) *ThreadMember

func (*GuildPublicThread) ThreadMembers

func (c *GuildPublicThread) ThreadMembers() []*ThreadMember

func (*GuildPublicThread) Update

func (*GuildPublicThread) UpdateGuildChannel

func (c *GuildPublicThread) UpdateGuildChannel(guildChannelUpdate discord.GuildChannelUpdate, opts ...rest.RequestOpt) (GuildChannel, error)

func (*GuildPublicThread) UpdateMessage

func (c *GuildPublicThread) UpdateMessage(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

func (*GuildPublicThread) UpdatePermissionOverwrite

func (c *GuildPublicThread) UpdatePermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

type GuildScheduledEvent added in v0.6.1

type GuildScheduledEvent struct {
	discord.GuildScheduledEvent
	Creator *User
	Bot     *Bot
}

func (*GuildScheduledEvent) AudioChannel added in v0.6.1

func (e *GuildScheduledEvent) AudioChannel() GuildAudioChannel

func (*GuildScheduledEvent) Channel added in v0.6.1

func (e *GuildScheduledEvent) Channel() GuildChannel

func (*GuildScheduledEvent) Delete added in v0.6.1

func (e *GuildScheduledEvent) Delete(opts ...rest.RequestOpt) error

func (*GuildScheduledEvent) GetUsers added in v0.6.1

func (e *GuildScheduledEvent) GetUsers(limit int, withMember bool, before discord.Snowflake, after discord.Snowflake, opts ...rest.RequestOpt) ([]*GuildScheduledEventUser, error)

func (*GuildScheduledEvent) Guild added in v0.6.1

func (e *GuildScheduledEvent) Guild() *Guild

func (*GuildScheduledEvent) StageInstanceEntity added in v0.6.1

func (e *GuildScheduledEvent) StageInstanceEntity() *StageInstance

func (*GuildScheduledEvent) Update added in v0.6.1

func (e *GuildScheduledEvent) Update(guildScheduledEventUpdate discord.GuildScheduledEventUpdate, opts ...rest.RequestOpt) (*GuildScheduledEvent, error)

func (*GuildScheduledEvent) VoiceChannelEntity added in v0.6.1

func (e *GuildScheduledEvent) VoiceChannelEntity() *GuildVoiceChannel

type GuildScheduledEventCache added in v0.6.1

type GuildScheduledEventCache interface {
	Get(guildScheduledEventID discord.Snowflake) *GuildScheduledEvent
	GetCopy(guildScheduledEventID discord.Snowflake) *GuildScheduledEvent
	Set(guildScheduledEvent *GuildScheduledEvent) *GuildScheduledEvent
	Remove(guildScheduledEventID discord.Snowflake)

	Cache() map[discord.Snowflake]*GuildScheduledEvent
	All() []*GuildScheduledEvent

	FindFirst(guildScheduledEventFindFunc GuildScheduledEventFindFunc) *GuildScheduledEvent
	FindAll(guildScheduledEventFindFunc GuildScheduledEventFindFunc) []*GuildScheduledEvent
}

func NewGuildScheduledEventCache added in v0.6.1

func NewGuildScheduledEventCache(cacheFlags CacheFlags) GuildScheduledEventCache

type GuildScheduledEventFindFunc added in v0.6.1

type GuildScheduledEventFindFunc func(guildScheduledEvent *GuildScheduledEvent) bool

type GuildScheduledEventUser added in v0.6.1

type GuildScheduledEventUser struct {
	discord.GuildScheduledEventUser
	User   *User
	Member *Member
	Bot    *Bot
}

type GuildStageVoiceChannel

type GuildStageVoiceChannel struct {
	discord.GuildStageVoiceChannel
	Bot                *Bot
	StageInstanceID    *discord.Snowflake
	ConnectedMemberIDs map[discord.Snowflake]struct{}
}

func (*GuildStageVoiceChannel) Connect

func (c *GuildStageVoiceChannel) Connect(ctx context.Context) error

func (*GuildStageVoiceChannel) CreateStageInstance

func (c *GuildStageVoiceChannel) CreateStageInstance(stageInstanceCreate discord.StageInstanceCreate, opts ...rest.RequestOpt) (*StageInstance, error)

func (*GuildStageVoiceChannel) Delete

func (c *GuildStageVoiceChannel) Delete(opts ...rest.RequestOpt) error

func (*GuildStageVoiceChannel) DeletePermissionOverwrite

func (c *GuildStageVoiceChannel) DeletePermissionOverwrite(id discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildStageVoiceChannel) DeleteStageInstance

func (c *GuildStageVoiceChannel) DeleteStageInstance(opts ...rest.RequestOpt) error

func (*GuildStageVoiceChannel) Guild

func (c *GuildStageVoiceChannel) Guild() *Guild

func (*GuildStageVoiceChannel) IsModerator

func (c *GuildStageVoiceChannel) IsModerator(member *Member) bool

func (*GuildStageVoiceChannel) MemberPermissionOverwrite

func (c *GuildStageVoiceChannel) MemberPermissionOverwrite(id discord.Snowflake) *discord.MemberPermissionOverwrite

func (*GuildStageVoiceChannel) Members

func (c *GuildStageVoiceChannel) Members() []*Member

func (*GuildStageVoiceChannel) Parent

func (*GuildStageVoiceChannel) PermissionOverwrite

func (*GuildStageVoiceChannel) PermissionOverwrites

func (c *GuildStageVoiceChannel) PermissionOverwrites() []discord.PermissionOverwrite

func (*GuildStageVoiceChannel) RolePermissionOverwrite

func (*GuildStageVoiceChannel) SetPermissionOverwrite

func (c *GuildStageVoiceChannel) SetPermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

func (*GuildStageVoiceChannel) StageInstance

func (c *GuildStageVoiceChannel) StageInstance() *StageInstance

func (*GuildStageVoiceChannel) Update

Update updates the GuildNewsChannel which can return either a GuildNewsChannel or a GuildTextChannel

func (*GuildStageVoiceChannel) UpdateGuildChannel

func (c *GuildStageVoiceChannel) UpdateGuildChannel(guildChannelUpdate discord.GuildChannelUpdate, opts ...rest.RequestOpt) (GuildChannel, error)

func (*GuildStageVoiceChannel) UpdatePermissionOverwrite

func (c *GuildStageVoiceChannel) UpdatePermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

func (*GuildStageVoiceChannel) UpdateStageInstance

func (c *GuildStageVoiceChannel) UpdateStageInstance(stageInstanceUpdate discord.StageInstanceUpdate, opts ...rest.RequestOpt) (*StageInstance, error)

type GuildStoreChannel

type GuildStoreChannel struct {
	discord.GuildStoreChannel
	Bot *Bot
}

func (*GuildStoreChannel) Delete

func (c *GuildStoreChannel) Delete(opts ...rest.RequestOpt) error

func (*GuildStoreChannel) DeletePermissionOverwrite

func (c *GuildStoreChannel) DeletePermissionOverwrite(id discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildStoreChannel) Guild

func (c *GuildStoreChannel) Guild() *Guild

func (*GuildStoreChannel) MemberPermissionOverwrite

func (c *GuildStoreChannel) MemberPermissionOverwrite(id discord.Snowflake) *discord.MemberPermissionOverwrite

func (*GuildStoreChannel) Members

func (c *GuildStoreChannel) Members() []*Member

func (*GuildStoreChannel) Parent

func (*GuildStoreChannel) PermissionOverwrite

func (*GuildStoreChannel) PermissionOverwrites

func (c *GuildStoreChannel) PermissionOverwrites() []discord.PermissionOverwrite

func (*GuildStoreChannel) RolePermissionOverwrite

func (c *GuildStoreChannel) RolePermissionOverwrite(id discord.Snowflake) *discord.RolePermissionOverwrite

func (*GuildStoreChannel) SetPermissionOverwrite

func (c *GuildStoreChannel) SetPermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

func (*GuildStoreChannel) Update

Update updates the GuildNewsChannel which can return either a GuildNewsChannel or a GuildTextChannel

func (*GuildStoreChannel) UpdateGuildChannel

func (c *GuildStoreChannel) UpdateGuildChannel(guildChannelUpdate discord.GuildChannelUpdate, opts ...rest.RequestOpt) (GuildChannel, error)

func (*GuildStoreChannel) UpdatePermissionOverwrite

func (c *GuildStoreChannel) UpdatePermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

type GuildTemplate

type GuildTemplate struct {
	discord.GuildTemplate
	Bot     *Bot
	Creator *User
}

func (*GuildTemplate) CreateGuild

func (t *GuildTemplate) CreateGuild(createGuildFromTemplate discord.GuildFromTemplateCreate, opts ...rest.RequestOpt) (*Guild, error)

CreateGuild creates a Guild from this discord.GuildTemplate

func (*GuildTemplate) Delete

func (t *GuildTemplate) Delete(opts ...rest.RequestOpt) (*GuildTemplate, error)

Delete deletes the GuildTemplate

func (*GuildTemplate) Guild

func (t *GuildTemplate) Guild() *Guild

Guild returns the Guild this GuildTemplate is for. This will only check cached guilds!

func (*GuildTemplate) Sync

func (t *GuildTemplate) Sync(opts ...rest.RequestOpt) (*GuildTemplate, error)

Sync updates the GuildTemplate with the provided discord.UpdateGuildTemplate

func (*GuildTemplate) Update

func (t *GuildTemplate) Update(guildTemplateUpdate discord.GuildTemplateUpdate, opts ...rest.RequestOpt) (*GuildTemplate, error)

Update updates the GuildTemplate with the provided discord.UpdateGuildTemplate

type GuildTextChannel

type GuildTextChannel struct {
	discord.GuildTextChannel
	Bot *Bot
}

func (*GuildTextChannel) AddReaction

func (c *GuildTextChannel) AddReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildTextChannel) BulkDeleteMessages

func (c *GuildTextChannel) BulkDeleteMessages(messageIDs []discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildTextChannel) CreateMessage

func (c *GuildTextChannel) CreateMessage(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

func (*GuildTextChannel) CreateThread

func (c *GuildTextChannel) CreateThread(theadCreate discord.ThreadCreate, opts ...rest.RequestOpt) (GuildThread, error)

func (*GuildTextChannel) CreateThreadWithMessage

func (c *GuildTextChannel) CreateThreadWithMessage(messageID discord.Snowflake, threadCreateWithMessage discord.ThreadCreateWithMessage, opts ...rest.RequestOpt) (GuildThread, error)

func (*GuildTextChannel) CreateWebhook

func (c *GuildTextChannel) CreateWebhook(webhookCreate discord.WebhookCreate, opts ...rest.RequestOpt) (Webhook, error)

func (*GuildTextChannel) Delete

func (c *GuildTextChannel) Delete(opts ...rest.RequestOpt) error

func (*GuildTextChannel) DeleteMessage

func (c *GuildTextChannel) DeleteMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildTextChannel) DeletePermissionOverwrite

func (c *GuildTextChannel) DeletePermissionOverwrite(id discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildTextChannel) DeleteWebhook

func (c *GuildTextChannel) DeleteWebhook(webhookID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildTextChannel) GetJoinedPrivateAchievedThreads

func (c *GuildTextChannel) GetJoinedPrivateAchievedThreads(before discord.Time, limit int, opts ...rest.RequestOpt) ([]*GuildPrivateThread, map[discord.Snowflake]*ThreadMember, bool, error)

func (*GuildTextChannel) GetMessage

func (c *GuildTextChannel) GetMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*GuildTextChannel) GetMessages

func (c *GuildTextChannel) GetMessages(around discord.Snowflake, before discord.Snowflake, after discord.Snowflake, limit int, opts ...rest.RequestOpt) ([]*Message, error)

func (*GuildTextChannel) GetPrivateArchivedThreads

func (c *GuildTextChannel) GetPrivateArchivedThreads(before discord.Time, limit int, opts ...rest.RequestOpt) ([]*GuildPrivateThread, map[discord.Snowflake]*ThreadMember, bool, error)

func (*GuildTextChannel) GetPublicArchivedThreads

func (c *GuildTextChannel) GetPublicArchivedThreads(before discord.Time, limit int, opts ...rest.RequestOpt) ([]GuildThread, map[discord.Snowflake]*ThreadMember, bool, error)

func (*GuildTextChannel) GetWebhooks

func (c *GuildTextChannel) GetWebhooks(opts ...rest.RequestOpt) ([]Webhook, error)

func (*GuildTextChannel) Guild

func (c *GuildTextChannel) Guild() *Guild

func (*GuildTextChannel) MemberPermissionOverwrite

func (c *GuildTextChannel) MemberPermissionOverwrite(id discord.Snowflake) *discord.MemberPermissionOverwrite

func (*GuildTextChannel) Members

func (c *GuildTextChannel) Members() []*Member

func (*GuildTextChannel) Parent

func (*GuildTextChannel) PermissionOverwrite

func (*GuildTextChannel) PermissionOverwrites

func (c *GuildTextChannel) PermissionOverwrites() []discord.PermissionOverwrite

func (*GuildTextChannel) PrivateThreads

func (c *GuildTextChannel) PrivateThreads() []*GuildPrivateThread

func (*GuildTextChannel) PublicThreads

func (c *GuildTextChannel) PublicThreads() []*GuildPublicThread

func (*GuildTextChannel) RemoveAllReactions

func (c *GuildTextChannel) RemoveAllReactions(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildTextChannel) RemoveAllReactionsForEmoji

func (c *GuildTextChannel) RemoveAllReactionsForEmoji(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildTextChannel) RemoveOwnReaction

func (c *GuildTextChannel) RemoveOwnReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error

func (*GuildTextChannel) RemoveUserReaction

func (c *GuildTextChannel) RemoveUserReaction(messageID discord.Snowflake, emoji string, userID discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildTextChannel) RolePermissionOverwrite

func (c *GuildTextChannel) RolePermissionOverwrite(id discord.Snowflake) *discord.RolePermissionOverwrite

func (*GuildTextChannel) SendTyping

func (c *GuildTextChannel) SendTyping(opts ...rest.RequestOpt) error

func (*GuildTextChannel) SetPermissionOverwrite

func (c *GuildTextChannel) SetPermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

func (*GuildTextChannel) Thread

func (c *GuildTextChannel) Thread(threadID discord.Snowflake) GuildThread

func (*GuildTextChannel) Threads

func (c *GuildTextChannel) Threads() []GuildThread

func (*GuildTextChannel) Update

Update updates the GuildNewsChannel which can return either a GuildNewsChannel or a GuildTextChannel

func (*GuildTextChannel) UpdateGuildChannel

func (c *GuildTextChannel) UpdateGuildChannel(guildChannelUpdate discord.GuildChannelUpdate, opts ...rest.RequestOpt) (GuildChannel, error)

func (*GuildTextChannel) UpdateMessage

func (c *GuildTextChannel) UpdateMessage(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

func (*GuildTextChannel) UpdatePermissionOverwrite

func (c *GuildTextChannel) UpdatePermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

type GuildThread

type GuildThread interface {
	discord.GuildThread
	BaseGuildMessageChannel

	ParentMessageChannel() GuildMessageChannel
	SelfThreadMember() *ThreadMember
	ThreadMember(userID discord.Snowflake) *ThreadMember
	ThreadMembers() []*ThreadMember
	Join(opts ...rest.RequestOpt) error
	Leave(opts ...rest.RequestOpt) error
	AddThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) error
	RemoveThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) error
	GetThreadMember(userID discord.Snowflake, opts ...rest.RequestOpt) (*ThreadMember, error)
	GetThreadMembers(opts ...rest.RequestOpt) ([]*ThreadMember, error)
}

type GuildVoiceChannel

type GuildVoiceChannel struct {
	discord.GuildVoiceChannel
	Bot                *Bot
	ConnectedMemberIDs map[discord.Snowflake]struct{}
}

func (*GuildVoiceChannel) Connect

func (c *GuildVoiceChannel) Connect(ctx context.Context) error

func (*GuildVoiceChannel) Delete

func (c *GuildVoiceChannel) Delete(opts ...rest.RequestOpt) error

func (*GuildVoiceChannel) DeletePermissionOverwrite

func (c *GuildVoiceChannel) DeletePermissionOverwrite(id discord.Snowflake, opts ...rest.RequestOpt) error

func (*GuildVoiceChannel) Guild

func (c *GuildVoiceChannel) Guild() *Guild

func (*GuildVoiceChannel) MemberPermissionOverwrite

func (c *GuildVoiceChannel) MemberPermissionOverwrite(id discord.Snowflake) *discord.MemberPermissionOverwrite

func (*GuildVoiceChannel) Members

func (c *GuildVoiceChannel) Members() []*Member

func (*GuildVoiceChannel) Parent

func (*GuildVoiceChannel) PermissionOverwrite

func (*GuildVoiceChannel) PermissionOverwrites

func (c *GuildVoiceChannel) PermissionOverwrites() []discord.PermissionOverwrite

func (*GuildVoiceChannel) RolePermissionOverwrite

func (c *GuildVoiceChannel) RolePermissionOverwrite(id discord.Snowflake) *discord.RolePermissionOverwrite

func (*GuildVoiceChannel) SetPermissionOverwrite

func (c *GuildVoiceChannel) SetPermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

func (*GuildVoiceChannel) Update

Update updates the GuildNewsChannel which can return either a GuildNewsChannel or a GuildTextChannel

func (*GuildVoiceChannel) UpdateGuildChannel

func (c *GuildVoiceChannel) UpdateGuildChannel(guildChannelUpdate discord.GuildChannelUpdate, opts ...rest.RequestOpt) (GuildChannel, error)

func (*GuildVoiceChannel) UpdatePermissionOverwrite

func (c *GuildVoiceChannel) UpdatePermissionOverwrite(overwriteType discord.PermissionOverwriteType, id discord.Snowflake, allow discord.Permissions, deny discord.Permissions, opts ...rest.RequestOpt) error

type HTTPServerEventHandler

type HTTPServerEventHandler interface {
	New() interface{}
	HandleHTTPEvent(bot *Bot, responseChannel chan<- discord.InteractionResponse, v interface{})
}

HTTPServerEventHandler is used to handle HTTP Event(s)

type IncomingWebhook

type IncomingWebhook struct {
	discord.IncomingWebhook
	Bot  *Bot
	User *User
}

func (*IncomingWebhook) Delete

func (h *IncomingWebhook) Delete(opts ...rest.RequestOpt) error

func (*IncomingWebhook) NewWebhookClient

func (h *IncomingWebhook) NewWebhookClient(opts ...webhook.ConfigOpt) *webhook.Client

func (*IncomingWebhook) URL

func (h *IncomingWebhook) URL() string

func (*IncomingWebhook) Update

func (h *IncomingWebhook) Update(webhookUpdate discord.WebhookUpdate, opts ...rest.RequestOpt) (*IncomingWebhook, error)

type Integration

type Integration interface {
	discord.Integration
}

type IntegrationApplication

type IntegrationApplication struct {
	discord.IntegrationApplication
	Bot *User
}

type Interaction

type Interaction interface {
	discord.Interaction
}

Interaction represents a generic Interaction received from discord

type InteractionFields

type InteractionFields struct {
	Bot             *Bot
	User            *User
	Member          *Member
	ResponseChannel chan<- discord.InteractionResponse
	Acknowledged    bool
}

type InteractionFilter

type InteractionFilter func(interaction Interaction) bool

type Invite

type Invite struct {
	discord.Invite
	Bot        *Bot
	Inviter    *User
	TargetUser *User
}

func (*Invite) Delete

func (i *Invite) Delete(opts ...rest.RequestOpt) (*Invite, error)

Delete deletes this Invite

func (*Invite) URL

func (i *Invite) URL() string

URL returns the invite URL in format like https://discord.gg/{code}

type Member

type Member struct {
	discord.Member
	User *User
	Bot  *Bot
}

func (*Member) AddRole

func (m *Member) AddRole(roleID discord.Snowflake, opts ...rest.RequestOpt) error

AddRole adds a specific Role the Member

func (*Member) AvatarURL

func (m *Member) AvatarURL(size int) *string

AvatarURL returns the Avatar URL of the Member for this guild

func (*Member) Ban

func (m *Member) Ban(deleteMessageDays int, opts ...rest.RequestOpt) error

Ban bans this Member from the Guild

func (*Member) ChannelPermissions

func (m *Member) ChannelPermissions(channel GuildChannel) discord.Permissions

ChannelPermissions returns the Permissions the Member has in the provided Channel

func (*Member) EffectiveAvatarURL

func (m *Member) EffectiveAvatarURL(size int) string

EffectiveAvatarURL returns either the server avatar or global avatar depending on if the user has one

func (*Member) Guild

func (m *Member) Guild() *Guild

Guild returns the Guild this Member is tied to. This will only check cached guilds!

func (*Member) InteractionPermissions

func (m *Member) InteractionPermissions() discord.Permissions

InteractionPermissions returns the Permissions the Member has in this Channel for this Interaction

func (*Member) IsOwner

func (m *Member) IsOwner() bool

IsOwner returns whether this Member is the owner of the Guild

func (*Member) Kick

func (m *Member) Kick(opts ...rest.RequestOpt) error

Kick kicks this Member from the Guild

func (*Member) Move

func (m *Member) Move(channelID discord.Snowflake, opts ...rest.RequestOpt) (*Member, error)

Move moves/kicks the member to/from a voice channel

func (*Member) Permissions

func (m *Member) Permissions() discord.Permissions

Permissions returns the calculated Permissions the Member has in the Guild

func (*Member) RemoveRole

func (m *Member) RemoveRole(roleID discord.Snowflake, opts ...rest.RequestOpt) error

RemoveRole removes a specific Role this Member

func (*Member) Roles

func (m *Member) Roles() []*Role

Roles return all Role(s)the Member has

func (*Member) Unban

func (m *Member) Unban(opts ...rest.RequestOpt) error

Unban unbans this Member from the Guild

func (*Member) Update

func (m *Member) Update(updateGuildMember discord.MemberUpdate, opts ...rest.RequestOpt) (*Member, error)

Update updates the Member with the properties provided in discord.MemberUpdate

func (*Member) VoiceState

func (m *Member) VoiceState() *VoiceState

VoiceState returns the VoiceState for this Member. This will only check cached voice states! (requires core.CacheFlagVoiceStates and discord.GatewayIntentGuildVoiceStates)

type MemberCache

type MemberCache interface {
	Get(guildID discord.Snowflake, userID discord.Snowflake) *Member
	GetCopy(guildID discord.Snowflake, userID discord.Snowflake) *Member
	Set(member *Member) *Member
	Remove(guildID discord.Snowflake, userID discord.Snowflake)
	RemoveAll(guildID discord.Snowflake)

	Cache() map[discord.Snowflake]map[discord.Snowflake]*Member
	All() map[discord.Snowflake][]*Member

	GuildCache(guildID discord.Snowflake) map[discord.Snowflake]*Member
	GuildAll(guildID discord.Snowflake) []*Member

	FindFirst(memberFindFunc MemberFindFunc) *Member
	FindAll(memberFindFunc MemberFindFunc) []*Member
}

func NewMemberCache

func NewMemberCache(memberCachePolicy MemberCachePolicy) MemberCache

type MemberCachePolicy

type MemberCachePolicy func(*Member) bool

MemberCachePolicy can be used to define your own policy for caching members

var (
	MemberCachePolicyNone    MemberCachePolicy = func(_ *Member) bool { return false }
	MemberCachePolicyAll     MemberCachePolicy = func(_ *Member) bool { return true }
	MemberCachePolicyOwner   MemberCachePolicy = func(member *Member) bool { return member.IsOwner() }
	MemberCachePolicyOnline  MemberCachePolicy = func(_ *Member) bool { return false }
	MemberCachePolicyVoice   MemberCachePolicy = func(member *Member) bool { return false }
	MemberCachePolicyPending MemberCachePolicy = func(member *Member) bool { return member.Pending }
	MemberCachePolicyDefault                   = MemberCachePolicyOwner.Or(MemberCachePolicyVoice)
)

Default member caches policies

func MemberCachePolicyAllOf

func MemberCachePolicyAllOf(policy MemberCachePolicy, policies ...MemberCachePolicy) MemberCachePolicy

MemberCachePolicyAllOf is a shorthand for MemberCachePolicy.And(MemberCachePolicy).And(MemberCachePolicy) etc.

func MemberCachePolicyAnyOf

func MemberCachePolicyAnyOf(policy MemberCachePolicy, policies ...MemberCachePolicy) MemberCachePolicy

MemberCachePolicyAnyOf is a shorthand for MemberCachePolicy.Or(MemberCachePolicy).Or(MemberCachePolicy) etc.

func (MemberCachePolicy) And

And allows you to require both policies to be true for the member to be cached

func (MemberCachePolicy) Or

Or allows you to combine that policy with another, meaning either needs to be true

type MemberChunkingFilter

type MemberChunkingFilter func(guildID discord.Snowflake) bool
var (
	MemberChunkingFilterAll  MemberChunkingFilter = func(_ discord.Snowflake) bool { return true }
	MemberChunkingFilterNone MemberChunkingFilter = func(_ discord.Snowflake) bool { return false }
)

func (MemberChunkingFilter) Exclude

func (MemberChunkingFilter) Include

type MemberChunkingManager

type MemberChunkingManager interface {
	Bot() *Bot
	MemberChunkingFilter() MemberChunkingFilter

	HandleChunk(payload discord.GuildMembersChunkGatewayEvent)

	RequestMembers(guildID discord.Snowflake, userIDs ...discord.Snowflake) ([]*Member, error)
	RequestMembersWithQuery(guildID discord.Snowflake, query string, limit int) ([]*Member, error)
	RequestMembersWithFilter(guildID discord.Snowflake, memberFilterFunc func(member *Member) bool) ([]*Member, error)

	RequestMembersCtx(ctx context.Context, guildID discord.Snowflake, userIDs ...discord.Snowflake) ([]*Member, error)
	RequestMembersWithQueryCtx(ctx context.Context, guildID discord.Snowflake, query string, limit int) ([]*Member, error)
	RequestMembersWithFilterCtx(ctx context.Context, guildID discord.Snowflake, memberFilterFunc func(member *Member) bool) ([]*Member, error)

	RequestMembersChan(guildID discord.Snowflake, userIDs ...discord.Snowflake) (<-chan *Member, func(), error)
	RequestMembersWithQueryChan(guildID discord.Snowflake, query string, limit int) (<-chan *Member, func(), error)
	RequestMembersWithFilterChan(guildID discord.Snowflake, memberFilterFunc func(member *Member) bool) (<-chan *Member, func(), error)
}

func NewMemberChunkingManager

func NewMemberChunkingManager(bot *Bot, memberChunkingFilter MemberChunkingFilter) MemberChunkingManager

type MemberFindFunc

type MemberFindFunc func(member *Member) bool

type Mentionable

type Mentionable interface {
	Mention() string
}

type Message

type Message struct {
	discord.Message
	Bot      *Bot
	Member   *Member
	Author   *User
	Stickers []*MessageSticker
}

func (*Message) ActionRows

func (m *Message) ActionRows() []discord.ActionRowComponent

ActionRows returns all discord.ActionRowComponent(s) from this Message

func (*Message) AddReaction

func (m *Message) AddReaction(emoji string, opts ...rest.RequestOpt) error

AddReaction allows you to add a reaction to a message_events from a string, for _examples a custom emoji CommandID, or a native emoji

func (*Message) AddReactionByEmote

func (m *Message) AddReactionByEmote(emote Emoji, opts ...rest.RequestOpt) error

AddReactionByEmote allows you to add an Emoji to a message_events via reaction

func (*Message) ButtonByID

func (m *Message) ButtonByID(customID discord.CustomID) *discord.ButtonComponent

ButtonByID returns a ButtonComponent with the specific customID from this Message

func (*Message) Buttons

func (m *Message) Buttons() []discord.ButtonComponent

Buttons returns all ButtonComponent(s) from this Message

func (*Message) Channel

func (m *Message) Channel() MessageChannel

Channel gets the MessageChannel the Message was sent in

func (*Message) ComponentByID

func (m *Message) ComponentByID(customID discord.CustomID) discord.InteractiveComponent

ComponentByID returns the discord.Component with the specific discord.CustomID

func (*Message) CreateThread

func (m *Message) CreateThread(threadCreateWithMessage discord.ThreadCreateWithMessage, opts ...rest.RequestOpt) (GuildThread, error)

func (*Message) Crosspost

func (m *Message) Crosspost(opts ...rest.RequestOpt) (*Message, error)

Crosspost crossposts an existing message

func (*Message) Delete

func (m *Message) Delete(opts ...rest.RequestOpt) error

Delete deletes this Message

func (*Message) Guild

func (m *Message) Guild() *Guild

Guild returns the Guild this Message was sent in. This will only check cached guilds!

func (*Message) InteractiveComponents

func (m *Message) InteractiveComponents() []discord.InteractiveComponent

InteractiveComponents returns the discord.InteractiveComponent(s) from this Message

func (*Message) IsEphemeral

func (m *Message) IsEphemeral() bool

IsEphemeral returns true if the Message has MessageFlagEphemeral

func (*Message) IsWebhookMessage

func (m *Message) IsWebhookMessage() bool

IsWebhookMessage returns true if the Message was sent by a Webhook

func (*Message) Reply

func (m *Message) Reply(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

Reply replies to this Message

func (*Message) SelectMenuByID

func (m *Message) SelectMenuByID(customID discord.CustomID) *discord.SelectMenuComponent

SelectMenuByID returns a SelectMenuComponent with the specific customID from this Message

func (*Message) SelectMenus

func (m *Message) SelectMenus() []discord.SelectMenuComponent

SelectMenus returns all SelectMenuComponent(s) from this Message

func (*Message) Update

func (m *Message) Update(messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

Update allows you to edit an existing Message sent by you

type MessageCache

type MessageCache interface {
	Get(channelID discord.Snowflake, messageID discord.Snowflake) *Message
	GetCopy(channelID discord.Snowflake, messageID discord.Snowflake) *Message
	Set(message *Message) *Message
	Remove(channelID discord.Snowflake, messageID discord.Snowflake)

	Cache() map[discord.Snowflake]map[discord.Snowflake]*Message
	All() map[discord.Snowflake][]*Message

	ChannelCache(channelID discord.Snowflake) map[discord.Snowflake]*Message
	ChannelAll(channelID discord.Snowflake) []*Message

	FindFirst(messageFindFunc MessageFindFunc) *Message
	FindAll(messageFindFunc MessageFindFunc) []*Message
}

func NewMessageCache

func NewMessageCache(messageCachePolicy MessageCachePolicy) MessageCache

type MessageCachePolicy

type MessageCachePolicy func(message *Message) bool

MessageCachePolicy can be used to define your own policy for caching messages

var (
	MessageCachePolicyNone    MessageCachePolicy = func(_ *Message) bool { return false }
	MessageCachePolicyDefault                    = MessageCachePolicyNone
)

Default member caches policies

func MessageCachePolicyAll

func MessageCachePolicyAll(policy MessageCachePolicy, policies ...MessageCachePolicy) MessageCachePolicy

MessageCachePolicyAll is a shorthand for MessageCachePolicy.And(MessageCachePolicy).And(MessageCachePolicy) etc.

func MessageCachePolicyAny

func MessageCachePolicyAny(policy MessageCachePolicy, policies ...MessageCachePolicy) MessageCachePolicy

MessageCachePolicyAny is a shorthand for MessageCachePolicy.Or(MessageCachePolicy).Or(MessageCachePolicy) etc.

func MessageCachePolicyDuration

func MessageCachePolicyDuration(duration time.Duration) MessageCachePolicy

MessageCachePolicyDuration creates a new MessageCachePolicy which caches messages for the give duration

func (MessageCachePolicy) And

And allows you to require both policies to be true for the member to be cached

func (MessageCachePolicy) Or

Or allows you to combine that policy with another, meaning either needs to be true

type MessageChannel

type MessageChannel interface {
	discord.MessageChannel
	Channel

	SendTyping(opts ...rest.RequestOpt) error

	GetMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)
	GetMessages(around discord.Snowflake, before discord.Snowflake, after discord.Snowflake, limit int, opts ...rest.RequestOpt) ([]*Message, error)
	CreateMessage(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)
	UpdateMessage(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)
	DeleteMessage(messageID discord.Snowflake, opts ...rest.RequestOpt) error
	BulkDeleteMessages(messageIDs []discord.Snowflake, opts ...rest.RequestOpt) error

	AddReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error
	RemoveOwnReaction(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error
	RemoveUserReaction(messageID discord.Snowflake, emoji string, userID discord.Snowflake, opts ...rest.RequestOpt) error
	RemoveAllReactions(messageID discord.Snowflake, opts ...rest.RequestOpt) error
	RemoveAllReactionsForEmoji(messageID discord.Snowflake, emoji string, opts ...rest.RequestOpt) error
}

type MessageCommand

type MessageCommand struct {
	discord.MessageCommand
	Bot *Bot
}

func (*MessageCommand) Delete

func (c *MessageCommand) Delete(opts ...rest.RequestOpt) error

Delete deletes the ApplicationCommand from discord

func (*MessageCommand) GetPermissions

func (c *MessageCommand) GetPermissions(guildID discord.Snowflake, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error)

GetPermissions fetched the ApplicationCommandPermissions for a specific Guild from discord

func (*MessageCommand) Guild

func (c *MessageCommand) Guild() *Guild

Guild returns the Guild the ApplicationCommand is from the Caches or nil if it is a global ApplicationCommand

func (*MessageCommand) IsGlobal

func (c *MessageCommand) IsGlobal() bool

IsGlobal returns true if this is a global ApplicationCommand and false for a guild ApplicationCommand

func (*MessageCommand) SetPermissions

func (c *MessageCommand) SetPermissions(guildID discord.Snowflake, commandPermissions []discord.ApplicationCommandPermission, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error)

SetPermissions sets the ApplicationCommandPermissions for a specific Guild. this overrides all existing ApplicationCommandPermission(s). thx discord for that

func (*MessageCommand) ToCreate

ToCreate return the ApplicationCommandCreate for this ApplicationCommand

func (*MessageCommand) Update

func (c *MessageCommand) Update(commandUpdate discord.MessageCommandUpdate, opts ...rest.RequestOpt) (*MessageCommand, error)

Update updates the current ApplicationCommand with the given discord.ApplicationCommandUpdate

type MessageCommandInteraction

type MessageCommandInteraction struct {
	discord.MessageCommandInteraction
	*InteractionFields
	Data MessageCommandInteractionData
}

func (*MessageCommandInteraction) Create

func (i *MessageCommandInteraction) Create(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) error

func (*MessageCommandInteraction) CreateFollowup

func (i *MessageCommandInteraction) CreateFollowup(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

func (*MessageCommandInteraction) DeferCreate

func (i *MessageCommandInteraction) DeferCreate(ephemeral bool, opts ...rest.RequestOpt) error

func (*MessageCommandInteraction) DeleteFollowup

func (i *MessageCommandInteraction) DeleteFollowup(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*MessageCommandInteraction) DeleteOriginal

func (i *MessageCommandInteraction) DeleteOriginal(opts ...rest.RequestOpt) error

func (*MessageCommandInteraction) GetFollowup

func (i *MessageCommandInteraction) GetFollowup(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*MessageCommandInteraction) GetOriginal

func (i *MessageCommandInteraction) GetOriginal(opts ...rest.RequestOpt) (*Message, error)

func (*MessageCommandInteraction) Respond

func (*MessageCommandInteraction) TargetMessage

func (i *MessageCommandInteraction) TargetMessage() *Message

func (*MessageCommandInteraction) UpdateFollowup

func (i *MessageCommandInteraction) UpdateFollowup(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

func (*MessageCommandInteraction) UpdateOriginal

func (i *MessageCommandInteraction) UpdateOriginal(messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

type MessageCommandInteractionData

type MessageCommandInteractionData struct {
	discord.MessageCommandInteractionData
	Resolved *MessageCommandResolved
}

type MessageCommandInteractionFilter

type MessageCommandInteractionFilter func(messageCommandInteraction *MessageCommandInteraction) bool

type MessageCommandResolved

type MessageCommandResolved struct {
	Messages map[discord.Snowflake]*Message
}

type MessageFilter

type MessageFilter func(message *Message) bool

MessageFilter used to filter Message(s) in a collectors.MessageCollector

type MessageFindFunc

type MessageFindFunc func(message *Message) bool

type MessageReactionAdd

type MessageReactionAdd struct {
	UserID    discord.Snowflake
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
	GuildID   *discord.Snowflake
	Member    *Member
	Emoji     discord.ReactionEmoji
}

type MessageReactionAddFilter

type MessageReactionAddFilter func(e *MessageReactionAdd) bool

MessageReactionAddFilter used to filter MessageReactionAddEvent in a collectors.MessageReactionAddCollector

type MessageReactionRemove

type MessageReactionRemove struct {
	UserID    discord.Snowflake
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
	GuildID   *discord.Snowflake
	Emoji     discord.ReactionEmoji
}

type MessageReactionRemoveFilter

type MessageReactionRemoveFilter func(e *MessageReactionRemove) bool

MessageReactionRemoveFilter used to filter MessageReactionRemoveEvent in a collectors.MessageReactionRemoveCollector

type MessageSticker

type MessageSticker struct {
	discord.MessageSticker
	Bot *Bot
}

func (*MessageSticker) GetSticker

func (s *MessageSticker) GetSticker() (*Sticker, error)

func (*MessageSticker) URL

func (s *MessageSticker) URL(size int) string

type Presence

type Presence struct {
	discord.Presence
	Bot *Bot
}

func (*Presence) Guild

func (p *Presence) Guild() *Guild

Guild returns the Guild this Presence belongs to. This will only check cached guilds!

func (*Presence) Member

func (p *Presence) Member() *Member

Member returns the Member this Presence belongs to. This will only check cached members!

func (*Presence) User

func (p *Presence) User() *User

User returns the User this Presence belongs to. This will only check cached users!

type PresenceCache

type PresenceCache interface {
	Get(guildID discord.Snowflake, userID discord.Snowflake) *Presence
	GetCopy(guildID discord.Snowflake, userID discord.Snowflake) *Presence
	Set(presence *Presence) *Presence
	Remove(guildID discord.Snowflake, userID discord.Snowflake)

	Cache() map[discord.Snowflake]map[discord.Snowflake]*Presence
	All() map[discord.Snowflake][]*Presence

	GuildCache(guildID discord.Snowflake) map[discord.Snowflake]*Presence
	GuildAll(guildID discord.Snowflake) []*Presence

	FindFirst(presenceFindFunc PresenceFindFunc) *Presence
	FindAll(presenceFindFunc PresenceFindFunc) []*Presence
}

func NewPresenceCache

func NewPresenceCache(cacheFlags CacheFlags) PresenceCache

type PresenceFindFunc

type PresenceFindFunc func(presence *Presence) bool

type Role

type Role struct {
	discord.Role
	Bot *Bot
}

func (*Role) Delete

func (r *Role) Delete(opts ...rest.RequestOpt) error

Delete deletes this Role

func (*Role) Guild

func (r *Role) Guild() *Guild

Guild returns the Guild this Role belongs to. This will only check cached guilds!

func (*Role) IconURL

func (r *Role) IconURL(size int) *string

func (*Role) SetPosition

func (r *Role) SetPosition(rolePositionUpdate discord.RolePositionUpdate, opts ...rest.RequestOpt) ([]*Role, error)

SetPosition sets the position of this Role

func (*Role) Update

func (r *Role) Update(roleUpdate discord.RoleUpdate, opts ...rest.RequestOpt) (*Role, error)

Update updates this Role with the properties provided in discord.RoleUpdate

type RoleCache

type RoleCache interface {
	Get(guildID discord.Snowflake, roleID discord.Snowflake) *Role
	GetCopy(guildID discord.Snowflake, roleID discord.Snowflake) *Role
	Set(role *Role) *Role
	Remove(guildID discord.Snowflake, roleID discord.Snowflake)

	Cache() map[discord.Snowflake]map[discord.Snowflake]*Role
	All() map[discord.Snowflake][]*Role

	GuildCache(guildID discord.Snowflake) map[discord.Snowflake]*Role
	GuildAll(guildID discord.Snowflake) []*Role

	FindFirst(roleFindFunc RoleFindFunc) *Role
	FindAll(roleFindFunc RoleFindFunc) []*Role
}

func NewRoleCache

func NewRoleCache(cacheFlags CacheFlags) RoleCache

type RoleFindFunc

type RoleFindFunc func(role *Role) bool

type SelectMenuInteraction

type SelectMenuInteraction struct {
	discord.SelectMenuInteraction
	*InteractionFields
	Message *Message
}

func (*SelectMenuInteraction) Create

func (i *SelectMenuInteraction) Create(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) error

func (*SelectMenuInteraction) CreateFollowup

func (i *SelectMenuInteraction) CreateFollowup(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

func (*SelectMenuInteraction) DeferCreate

func (i *SelectMenuInteraction) DeferCreate(ephemeral bool, opts ...rest.RequestOpt) error

func (*SelectMenuInteraction) DeferUpdate

func (i *SelectMenuInteraction) DeferUpdate(opts ...rest.RequestOpt) error

func (*SelectMenuInteraction) DeleteFollowup

func (i *SelectMenuInteraction) DeleteFollowup(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*SelectMenuInteraction) DeleteOriginal

func (i *SelectMenuInteraction) DeleteOriginal(opts ...rest.RequestOpt) error

func (*SelectMenuInteraction) GetFollowup

func (i *SelectMenuInteraction) GetFollowup(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*SelectMenuInteraction) GetOriginal

func (i *SelectMenuInteraction) GetOriginal(opts ...rest.RequestOpt) (*Message, error)

func (*SelectMenuInteraction) Respond

func (*SelectMenuInteraction) SelectMenuComponent

func (i *SelectMenuInteraction) SelectMenuComponent() discord.SelectMenuComponent

SelectMenuComponent returns the SelectMenuComponent which issued this SelectMenuInteraction

func (*SelectMenuInteraction) SelectedOptions

func (i *SelectMenuInteraction) SelectedOptions() []discord.SelectMenuOption

SelectedOptions returns the selected SelectMenuOption(s)

func (*SelectMenuInteraction) Update

func (i *SelectMenuInteraction) Update(messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) error

func (*SelectMenuInteraction) UpdateFollowup

func (i *SelectMenuInteraction) UpdateFollowup(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

func (*SelectMenuInteraction) UpdateOriginal

func (i *SelectMenuInteraction) UpdateOriginal(messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

func (*SelectMenuInteraction) UpdateSelectMenu

func (i *SelectMenuInteraction) UpdateSelectMenu(selectMenu discord.SelectMenuComponent, opts ...rest.RequestOpt) error

UpdateSelectMenu updates the used SelectMenuComponent with a new SelectMenuComponent

type SelectMenuInteractionFilter

type SelectMenuInteractionFilter func(selectMenuInteraction *SelectMenuInteraction) bool

SelectMenuInteractionFilter used to filter SelectMenuInteraction(s) in a collectors.SelectMenuSubmitCollector

type SelfUser

type SelfUser struct {
	discord.OAuth2User
	Bot  *Bot
	User *User
}

func (*SelfUser) OpenDMChannel

func (u *SelfUser) OpenDMChannel(_ ...rest.RequestOpt) (*Channel, error)

OpenDMChannel creates a Channel between the user and the Bot

func (*SelfUser) Update

func (u *SelfUser) Update(updateSelfUser discord.SelfUserUpdate, opts ...rest.RequestOpt) (*SelfUser, error)

Update updates the SelfUser with the properties provided in discord.SelfUserUpdate

type SlashCommand

type SlashCommand struct {
	discord.SlashCommand
	Bot *Bot
}

func (*SlashCommand) Delete

func (c *SlashCommand) Delete(opts ...rest.RequestOpt) error

Delete deletes the ApplicationCommand from discord

func (*SlashCommand) GetPermissions

func (c *SlashCommand) GetPermissions(guildID discord.Snowflake, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error)

GetPermissions fetched the ApplicationCommandPermissions for a specific Guild from discord

func (*SlashCommand) Guild

func (c *SlashCommand) Guild() *Guild

Guild returns the Guild the ApplicationCommand is from the Caches or nil if it is a global ApplicationCommand

func (*SlashCommand) IsGlobal

func (c *SlashCommand) IsGlobal() bool

IsGlobal returns true if this is a global ApplicationCommand and false for a guild ApplicationCommand

func (*SlashCommand) SetPermissions

func (c *SlashCommand) SetPermissions(guildID discord.Snowflake, commandPermissions []discord.ApplicationCommandPermission, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error)

SetPermissions sets the ApplicationCommandPermissions for a specific Guild. this overrides all existing ApplicationCommandPermission(s). thx discord for that

func (*SlashCommand) ToCreate

func (c *SlashCommand) ToCreate() discord.SlashCommandCreate

ToCreate return the ApplicationCommandCreate for this ApplicationCommand

func (*SlashCommand) Update

func (c *SlashCommand) Update(commandUpdate discord.SlashCommandUpdate, opts ...rest.RequestOpt) (*SlashCommand, error)

Update updates the current ApplicationCommand with the given fields

type SlashCommandInteraction

type SlashCommandInteraction struct {
	discord.SlashCommandInteraction
	*InteractionFields
	Data SlashCommandInteractionData
}

func (*SlashCommandInteraction) Channel

func (i *SlashCommandInteraction) Channel() Channel

Channel returns the Channel from the Caches

func (*SlashCommandInteraction) CommandPath

func (i *SlashCommandInteraction) CommandPath() string

CommandPath returns the ApplicationCommand path

func (*SlashCommandInteraction) Create

func (i *SlashCommandInteraction) Create(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) error

func (*SlashCommandInteraction) CreateFollowup

func (i *SlashCommandInteraction) CreateFollowup(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

func (*SlashCommandInteraction) DeferCreate

func (i *SlashCommandInteraction) DeferCreate(ephemeral bool, opts ...rest.RequestOpt) error

func (*SlashCommandInteraction) DeleteFollowup

func (i *SlashCommandInteraction) DeleteFollowup(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*SlashCommandInteraction) DeleteOriginal

func (i *SlashCommandInteraction) DeleteOriginal(opts ...rest.RequestOpt) error

func (*SlashCommandInteraction) GetFollowup

func (i *SlashCommandInteraction) GetFollowup(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*SlashCommandInteraction) GetOriginal

func (i *SlashCommandInteraction) GetOriginal(opts ...rest.RequestOpt) (*Message, error)

func (*SlashCommandInteraction) Guild

func (i *SlashCommandInteraction) Guild() *Guild

Guild returns the Guild from the Caches

func (*SlashCommandInteraction) Respond

func (*SlashCommandInteraction) UpdateFollowup

func (i *SlashCommandInteraction) UpdateFollowup(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

func (*SlashCommandInteraction) UpdateOriginal

func (i *SlashCommandInteraction) UpdateOriginal(messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

type SlashCommandInteractionData

type SlashCommandInteractionData struct {
	discord.SlashCommandInteractionData
	SubCommandName      *string
	SubCommandGroupName *string
	Resolved            *SlashCommandResolved
	Options             SlashCommandOptionsMap
}

type SlashCommandInteractionFilter

type SlashCommandInteractionFilter func(slashCommandInteraction *SlashCommandInteraction) bool

type SlashCommandOption

type SlashCommandOption interface {
	discord.SlashCommandOption
}

type SlashCommandOptionBool

type SlashCommandOptionBool struct {
	discord.SlashCommandOptionBool
}

type SlashCommandOptionChannel

type SlashCommandOptionChannel struct {
	discord.SlashCommandOptionChannel
	Resolved *SlashCommandResolved
}

func (SlashCommandOptionChannel) Channel

func (o SlashCommandOptionChannel) Channel() Channel

type SlashCommandOptionFloat

type SlashCommandOptionFloat struct {
	discord.SlashCommandOptionFloat
}

type SlashCommandOptionInt

type SlashCommandOptionInt struct {
	discord.SlashCommandOptionInt
}

type SlashCommandOptionMentionable

type SlashCommandOptionMentionable struct {
	discord.SlashCommandOptionMentionable
	Resolved *SlashCommandResolved
}

func (SlashCommandOptionMentionable) Member

func (SlashCommandOptionMentionable) Role

func (SlashCommandOptionMentionable) User

type SlashCommandOptionRole

type SlashCommandOptionRole struct {
	discord.SlashCommandOptionRole
	Resolved *SlashCommandResolved
}

func (SlashCommandOptionRole) Role

func (o SlashCommandOptionRole) Role() *Role

type SlashCommandOptionString

type SlashCommandOptionString struct {
	discord.SlashCommandOptionString
	Resolved *SlashCommandResolved
}

func (*SlashCommandOptionString) MentionedChannels added in v0.6.6

func (o *SlashCommandOptionString) MentionedChannels() []Channel

func (*SlashCommandOptionString) MentionedMembers added in v0.6.6

func (o *SlashCommandOptionString) MentionedMembers() []*Member

func (*SlashCommandOptionString) MentionedRoles added in v0.6.6

func (o *SlashCommandOptionString) MentionedRoles() []*Role

func (*SlashCommandOptionString) MentionedUsers added in v0.6.6

func (o *SlashCommandOptionString) MentionedUsers() []*User

type SlashCommandOptionSubCommand

type SlashCommandOptionSubCommand struct {
	discord.SlashCommandOptionSubCommand
	Options []SlashCommandOption
}

type SlashCommandOptionSubCommandGroup

type SlashCommandOptionSubCommandGroup struct {
	discord.SlashCommandOptionSubCommandGroup
	Options []SlashCommandOptionSubCommand
}

type SlashCommandOptionUser

type SlashCommandOptionUser struct {
	discord.SlashCommandOptionUser
	Resolved *SlashCommandResolved
}

func (SlashCommandOptionUser) Member

func (o SlashCommandOptionUser) Member() *Member

func (SlashCommandOptionUser) User

func (o SlashCommandOptionUser) User() *User

type SlashCommandOptionsMap

type SlashCommandOptionsMap map[string]SlashCommandOption

func (SlashCommandOptionsMap) Bool

func (m SlashCommandOptionsMap) Bool(name string) *bool

func (SlashCommandOptionsMap) BoolOption

func (SlashCommandOptionsMap) Channel

func (m SlashCommandOptionsMap) Channel(name string) Channel

func (SlashCommandOptionsMap) ChannelOption

func (SlashCommandOptionsMap) Find

func (m SlashCommandOptionsMap) Find(optionFindFunc func(option SlashCommandOption) bool) SlashCommandOption

func (SlashCommandOptionsMap) FindAll

func (m SlashCommandOptionsMap) FindAll(optionFindFunc func(option SlashCommandOption) bool) []SlashCommandOption

func (SlashCommandOptionsMap) Float

func (m SlashCommandOptionsMap) Float(name string) *float64

func (SlashCommandOptionsMap) FloatOption

func (SlashCommandOptionsMap) Get

func (SlashCommandOptionsMap) GetAll

func (SlashCommandOptionsMap) GetByType

func (SlashCommandOptionsMap) Int

func (m SlashCommandOptionsMap) Int(name string) *int

func (SlashCommandOptionsMap) IntOption

func (SlashCommandOptionsMap) Member

func (m SlashCommandOptionsMap) Member(name string) *Member

func (SlashCommandOptionsMap) MentionableOption

func (m SlashCommandOptionsMap) MentionableOption(name string) *SlashCommandOptionMentionable

func (SlashCommandOptionsMap) Role

func (m SlashCommandOptionsMap) Role(name string) *Role

func (SlashCommandOptionsMap) RoleOption

func (SlashCommandOptionsMap) Snowflake

func (m SlashCommandOptionsMap) Snowflake(name string) *discord.Snowflake

func (SlashCommandOptionsMap) String

func (m SlashCommandOptionsMap) String(name string) *string

func (SlashCommandOptionsMap) StringOption

func (SlashCommandOptionsMap) User

func (m SlashCommandOptionsMap) User(name string) *User

func (SlashCommandOptionsMap) UserOption

type SlashCommandResolved

type SlashCommandResolved struct {
	Users    map[discord.Snowflake]*User
	Members  map[discord.Snowflake]*Member
	Roles    map[discord.Snowflake]*Role
	Channels map[discord.Snowflake]Channel
}

SlashCommandResolved contains resolved mention data for SlashCommand(s)

type StageInstance

type StageInstance struct {
	discord.StageInstance
	Bot *Bot
}

func (*StageInstance) Channel

func (i *StageInstance) Channel() *GuildStageVoiceChannel

Channel returns the Channel this StageInstance belongs to.

func (*StageInstance) Delete

func (i *StageInstance) Delete(opts ...rest.RequestOpt) error

Delete deletes this StageInstance

func (*StageInstance) GetListeners

func (i *StageInstance) GetListeners() []*Member

GetListeners returns the Member(s) that cannot speak in this StageInstance

func (*StageInstance) GetSpeakers

func (i *StageInstance) GetSpeakers() []*Member

GetSpeakers returns the Member(s) that can speak in this StageInstance

func (*StageInstance) Guild

func (i *StageInstance) Guild() *Guild

Guild returns the Guild this StageInstance belongs to. This will only check cached guilds!

func (*StageInstance) Update

func (i *StageInstance) Update(stageInstanceUpdate discord.StageInstanceUpdate, opts ...rest.RequestOpt) (*StageInstance, error)

type StageInstanceCache

type StageInstanceCache interface {
	Get(stageInstanceID discord.Snowflake) *StageInstance
	GetCopy(stageInstanceID discord.Snowflake) *StageInstance
	Set(stageInstance *StageInstance) *StageInstance
	Remove(stageInstanceID discord.Snowflake)

	Cache() map[discord.Snowflake]*StageInstance
	All() []*StageInstance

	FindFirst(stageInstanceFindFunc StageInstanceFindFunc) *StageInstance
	FindAll(stageInstanceFindFunc StageInstanceFindFunc) []*StageInstance
}

func NewStageInstanceCache

func NewStageInstanceCache(cacheFlags CacheFlags) StageInstanceCache

type StageInstanceFindFunc

type StageInstanceFindFunc func(stageInstance *StageInstance) bool

type Sticker

type Sticker struct {
	discord.Sticker
	Bot  *Bot
	User *User
}

func (*Sticker) Delete

func (s *Sticker) Delete(opts ...rest.RequestOpt) error

Delete deletes this Sticker

func (*Sticker) Guild

func (s *Sticker) Guild() *Guild

Guild returns the Guild this Sticker was created for or nil if this isn't a Guild-specific Sticker. This will only check cached guilds!

func (*Sticker) URL

func (s *Sticker) URL(size int) string

func (*Sticker) Update

func (s *Sticker) Update(stickerUpdate discord.StickerUpdate, opts ...rest.RequestOpt) (*Sticker, error)

Update updates this Sticker with the properties provided in discord.StickerUpdate

type StickerCache

type StickerCache interface {
	Get(guildID discord.Snowflake, stickerID discord.Snowflake) *Sticker
	GetCopy(guildID discord.Snowflake, stickerID discord.Snowflake) *Sticker
	Set(sticker *Sticker) *Sticker
	Remove(guildID discord.Snowflake, stickerID discord.Snowflake)

	Cache() map[discord.Snowflake]map[discord.Snowflake]*Sticker
	All() map[discord.Snowflake][]*Sticker

	GuildCache(guildID discord.Snowflake) map[discord.Snowflake]*Sticker
	GuildAll(guildID discord.Snowflake) []*Sticker

	FindFirst(stickerFindFunc StickerFindFunc) *Sticker
	FindAll(stickerFindFunc StickerFindFunc) []*Sticker
}

func NewStickerCache

func NewStickerCache(cacheFlags CacheFlags) StickerCache

type StickerFindFunc

type StickerFindFunc func(sticker *Sticker) bool

type StickerPack

type StickerPack struct {
	discord.StickerPack
	Bot      *Bot
	Stickers []*Sticker
}

func (*StickerPack) BannerAsset

func (p *StickerPack) BannerAsset(size int) string

func (*StickerPack) CoverSticker

func (p *StickerPack) CoverSticker() *Sticker

type ThreadMember

type ThreadMember struct {
	discord.ThreadMember
	Bot *Bot
}

type ThreadMemberCache

type ThreadMemberCache interface {
	Get(threadID discord.Snowflake, userID discord.Snowflake) *ThreadMember
	GetCopy(threadID discord.Snowflake, userID discord.Snowflake) *ThreadMember
	Set(threadMember *ThreadMember) *ThreadMember
	Remove(threadID discord.Snowflake, userID discord.Snowflake)
	RemoveAll(threadID discord.Snowflake)

	Cache() map[discord.Snowflake]map[discord.Snowflake]*ThreadMember
	All() map[discord.Snowflake][]*ThreadMember

	ThreadCache(threadID discord.Snowflake) map[discord.Snowflake]*ThreadMember
	ThreadAll(threadID discord.Snowflake) []*ThreadMember

	FindFirst(threadMemberFindFunc ThreadMemberFindFunc) *ThreadMember
	FindAll(threadMemberFindFunc ThreadMemberFindFunc) []*ThreadMember
}

func NewThreadMemberCache

func NewThreadMemberCache(cacheFlags CacheFlags) ThreadMemberCache

type ThreadMemberFindFunc

type ThreadMemberFindFunc func(threadMember *ThreadMember) bool

type TwitchIntegration

type TwitchIntegration struct {
	discord.TwitchIntegration
	Bot     *Bot
	GuildID discord.Snowflake
	User    *User
}

func (*TwitchIntegration) Delete

func (i *TwitchIntegration) Delete(opts ...rest.RequestOpt) error

Delete deletes the Integration from the Guild

func (*TwitchIntegration) Guild

func (i *TwitchIntegration) Guild() *Guild

Guild returns the Guild the Integration belongs to

func (*TwitchIntegration) Role

func (i *TwitchIntegration) Role() *Role

Role returns the Subscriber Role the Integration uses

type User

type User struct {
	discord.User
	Bot *Bot
}

func (*User) AvatarURL

func (u *User) AvatarURL(size int) *string

AvatarURL returns the Avatar URL of this User

func (*User) BannerURL

func (u *User) BannerURL(size int) *string

BannerURL returns the Banner URL of this User

func (*User) DefaultAvatarURL

func (u *User) DefaultAvatarURL(size int) string

DefaultAvatarURL returns the default avatar URL of this User

func (*User) EffectiveAvatarURL

func (u *User) EffectiveAvatarURL(size int) string

EffectiveAvatarURL returns either this User avatar or default avatar depending on if this User has one

func (*User) OpenDMChannel

func (u *User) OpenDMChannel(opts ...rest.RequestOpt) (*DMChannel, error)

OpenDMChannel creates a DMChannel between this User and the Bot

type UserCache

type UserCache interface {
	Get(userID discord.Snowflake) *User
	GetCopy(userID discord.Snowflake) *User
	Set(user *User) *User
	Remove(userID discord.Snowflake)

	Cache() map[discord.Snowflake]*User
	All() []*User

	FindFirst(userFindFunc UserFindFunc) *User
	FindAll(userFindFunc UserFindFunc) []*User
}

func NewUserCache

func NewUserCache(cacheFlags CacheFlags) UserCache

type UserCommand

type UserCommand struct {
	discord.UserCommand
	Bot *Bot
}

func (*UserCommand) Delete

func (c *UserCommand) Delete(opts ...rest.RequestOpt) error

Delete deletes the ApplicationCommand from discord

func (*UserCommand) GetPermissions

func (c *UserCommand) GetPermissions(guildID discord.Snowflake, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error)

GetPermissions fetched the ApplicationCommandPermissions for a specific Guild from discord

func (*UserCommand) Guild

func (c *UserCommand) Guild() *Guild

Guild returns the Guild the ApplicationCommand is from the Caches or nil if it is a global ApplicationCommand

func (*UserCommand) IsGlobal

func (c *UserCommand) IsGlobal() bool

IsGlobal returns true if this is a global ApplicationCommand and false for a guild ApplicationCommand

func (*UserCommand) SetPermissions

func (c *UserCommand) SetPermissions(guildID discord.Snowflake, commandPermissions []discord.ApplicationCommandPermission, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error)

SetPermissions sets the ApplicationCommandPermissions for a specific Guild. this overrides all existing ApplicationCommandPermission(s). thx discord for that

func (*UserCommand) ToCreate

func (c *UserCommand) ToCreate() discord.UserCommandCreate

ToCreate return the ApplicationCommandCreate for this ApplicationCommand

func (*UserCommand) Update

func (c *UserCommand) Update(commandUpdate discord.UserCommandUpdate, opts ...rest.RequestOpt) (*UserCommand, error)

Update updates the current ApplicationCommand with the given fields

type UserCommandInteraction

type UserCommandInteraction struct {
	discord.UserCommandInteraction
	*InteractionFields
	Data UserCommandInteractionData
}

func (*UserCommandInteraction) Create

func (i *UserCommandInteraction) Create(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) error

func (*UserCommandInteraction) CreateFollowup

func (i *UserCommandInteraction) CreateFollowup(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*Message, error)

func (*UserCommandInteraction) DeferCreate

func (i *UserCommandInteraction) DeferCreate(ephemeral bool, opts ...rest.RequestOpt) error

func (*UserCommandInteraction) DeleteFollowup

func (i *UserCommandInteraction) DeleteFollowup(messageID discord.Snowflake, opts ...rest.RequestOpt) error

func (*UserCommandInteraction) DeleteOriginal

func (i *UserCommandInteraction) DeleteOriginal(opts ...rest.RequestOpt) error

func (*UserCommandInteraction) GetFollowup

func (i *UserCommandInteraction) GetFollowup(messageID discord.Snowflake, opts ...rest.RequestOpt) (*Message, error)

func (*UserCommandInteraction) GetOriginal

func (i *UserCommandInteraction) GetOriginal(opts ...rest.RequestOpt) (*Message, error)

func (*UserCommandInteraction) Respond

func (*UserCommandInteraction) TargetMember

func (i *UserCommandInteraction) TargetMember() *Member

func (*UserCommandInteraction) TargetUser

func (i *UserCommandInteraction) TargetUser() *User

func (*UserCommandInteraction) UpdateFollowup

func (i *UserCommandInteraction) UpdateFollowup(messageID discord.Snowflake, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

func (*UserCommandInteraction) UpdateOriginal

func (i *UserCommandInteraction) UpdateOriginal(messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*Message, error)

type UserCommandInteractionData

type UserCommandInteractionData struct {
	discord.UserCommandInteractionData
	Resolved *UserCommandResolved
}

type UserCommandInteractionFilter

type UserCommandInteractionFilter func(userCommandInteraction *UserCommandInteraction) bool

type UserCommandResolved

type UserCommandResolved struct {
	Users   map[discord.Snowflake]*User
	Members map[discord.Snowflake]*Member
}

type UserFindFunc

type UserFindFunc func(user *User) bool

type VoiceState

type VoiceState struct {
	discord.VoiceState
	Bot    *Bot
	Member *Member
}

func (*VoiceState) Channel

func (s *VoiceState) Channel() Channel

Channel returns the Channel of this VoiceState from the Caches

func (*VoiceState) Deaf

func (s *VoiceState) Deaf() bool

Deaf returns whether the Member is deafened

func (*VoiceState) Guild

func (s *VoiceState) Guild() *Guild

Guild returns the Guild of this VoiceState. This will only check cached guilds!

func (*VoiceState) Mute

func (s *VoiceState) Mute() bool

Mute returns whether the Member is muted

func (*VoiceState) Update

func (s *VoiceState) Update(suppress *bool, requestToSpeak *discord.NullTime, opts ...rest.RequestOpt) error

func (*VoiceState) UpdateVoiceState

func (s *VoiceState) UpdateVoiceState(suppress *bool, requestToSpeak *discord.NullTime, opts ...rest.RequestOpt) error

type VoiceStateCache

type VoiceStateCache interface {
	Get(guildID discord.Snowflake, userID discord.Snowflake) *VoiceState
	GetCopy(guildID discord.Snowflake, userID discord.Snowflake) *VoiceState
	Set(voiceState *VoiceState) *VoiceState
	Remove(guildID discord.Snowflake, userID discord.Snowflake)

	Cache() map[discord.Snowflake]map[discord.Snowflake]*VoiceState
	All() map[discord.Snowflake][]*VoiceState

	GuildCache(guildID discord.Snowflake) map[discord.Snowflake]*VoiceState
	GuildAll(guildID discord.Snowflake) []*VoiceState

	FindFirst(voiceStateFindFunc VoiceStateFindFunc) *VoiceState
	FindAll(voiceStateFindFunc VoiceStateFindFunc) []*VoiceState
}

func NewVoiceStateCache

func NewVoiceStateCache(cacheFlags CacheFlags) VoiceStateCache

type VoiceStateFindFunc

type VoiceStateFindFunc func(voiceState *VoiceState) bool

type Webhook

type Webhook interface {
	discord.Webhook
}

type YouTubeIntegration

type YouTubeIntegration struct {
	discord.YouTubeIntegration
	Bot     *Bot
	GuildID discord.Snowflake
	User    *User
}

func (*YouTubeIntegration) Delete

func (i *YouTubeIntegration) Delete(opts ...rest.RequestOpt) error

Delete deletes the Integration from the Guild

func (*YouTubeIntegration) Guild

func (i *YouTubeIntegration) Guild() *Guild

Guild returns the Guild the Integration belongs to

func (*YouTubeIntegration) Role

func (i *YouTubeIntegration) Role() *Role

Role returns the Subscriber Role the Integration uses

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL