Documentation
¶
Index ¶
- func IDFromToken(token string) (*api.Snowflake, error)
- func New(token string, options api.Options) (api.Disgo, error)
- func NewBuilder(token string) api.DisgoBuilder
- type CacheImpl
- func (c *CacheImpl) AllCategories() []*api.Category
- func (c *CacheImpl) AllCategoryCache() map[api.Snowflake]map[api.Snowflake]*api.Category
- func (c *CacheImpl) AllMemberCache() map[api.Snowflake]map[api.Snowflake]*api.Member
- func (c *CacheImpl) AllMembers() []*api.Member
- func (c *CacheImpl) AllRoleCache() map[api.Snowflake]map[api.Snowflake]*api.Role
- func (c *CacheImpl) AllRoles() []*api.Role
- func (c *CacheImpl) AllStoreChannelCache() map[api.Snowflake]map[api.Snowflake]*api.StoreChannel
- func (c *CacheImpl) AllStoreChannels() []*api.StoreChannel
- func (c *CacheImpl) AllTextChannelCache() map[api.Snowflake]map[api.Snowflake]*api.TextChannel
- func (c *CacheImpl) AllTextChannels() []*api.TextChannel
- func (c *CacheImpl) AllVoiceChannelCache() map[api.Snowflake]map[api.Snowflake]*api.VoiceChannel
- func (c *CacheImpl) AllVoiceChannels() []*api.VoiceChannel
- func (c *CacheImpl) CacheCategory(category *api.Category)
- func (c *CacheImpl) CacheDMChannel(dmChannel *api.DMChannel)
- func (c *CacheImpl) CacheGuild(guild *api.Guild)
- func (c *CacheImpl) CacheMember(member *api.Member)
- func (c *CacheImpl) CacheRole(role *api.Role)
- func (c *CacheImpl) CacheStoreChannel(storeChannel *api.StoreChannel)
- func (c *CacheImpl) CacheTextChannel(textChannel *api.TextChannel)
- func (c *CacheImpl) CacheUser(user *api.User)
- func (c *CacheImpl) CacheVoiceChannel(voiceChannel *api.VoiceChannel)
- func (c *CacheImpl) Categories(guildID api.Snowflake) []*api.Category
- func (c *CacheImpl) CategoriesByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.Category
- func (c *CacheImpl) Category(categoryID api.Snowflake) *api.Category
- func (c *CacheImpl) CategoryCache(guildID api.Snowflake) map[api.Snowflake]*api.Category
- func (c *CacheImpl) Channel(channelID api.Snowflake) *api.Channel
- func (c *CacheImpl) Close()
- func (c *CacheImpl) DMChannel(dmChannelID api.Snowflake) *api.DMChannel
- func (c *CacheImpl) DMChannelCache() map[api.Snowflake]*api.DMChannel
- func (c *CacheImpl) DMChannels() []*api.DMChannel
- func (c *CacheImpl) DoCleanup()
- func (c *CacheImpl) FindCategories(guildID api.Snowflake, check func(u *api.Category) bool) []*api.Category
- func (c *CacheImpl) FindCategory(guildID api.Snowflake, check func(u *api.Category) bool) *api.Category
- func (c *CacheImpl) FindDMChannel(check func(u *api.DMChannel) bool) *api.DMChannel
- func (c *CacheImpl) FindDMChannels(check func(u *api.DMChannel) bool) []*api.DMChannel
- func (c *CacheImpl) FindGuild(check func(g *api.Guild) bool) *api.Guild
- func (c *CacheImpl) FindGuilds(check func(g *api.Guild) bool) []*api.Guild
- func (c *CacheImpl) FindMember(guildID api.Snowflake, check func(u *api.Member) bool) *api.Member
- func (c *CacheImpl) FindMembers(guildID api.Snowflake, check func(u *api.Member) bool) []*api.Member
- func (c *CacheImpl) FindRole(guildID api.Snowflake, check func(u *api.Role) bool) *api.Role
- func (c *CacheImpl) FindRoles(guildID api.Snowflake, check func(u *api.Role) bool) []*api.Role
- func (c *CacheImpl) FindStoreChannel(guildID api.Snowflake, check func(u *api.StoreChannel) bool) *api.StoreChannel
- func (c *CacheImpl) FindStoreChannels(guildID api.Snowflake, check func(u *api.StoreChannel) bool) []*api.StoreChannel
- func (c *CacheImpl) FindTextChannel(guildID api.Snowflake, check func(u *api.TextChannel) bool) *api.TextChannel
- func (c *CacheImpl) FindTextChannels(guildID api.Snowflake, check func(u *api.TextChannel) bool) []*api.TextChannel
- func (c *CacheImpl) FindUser(check func(u *api.User) bool) *api.User
- func (c *CacheImpl) FindUsers(check func(u *api.User) bool) []*api.User
- func (c *CacheImpl) FindVoiceChannel(guildID api.Snowflake, check func(u *api.VoiceChannel) bool) *api.VoiceChannel
- func (c *CacheImpl) FindVoiceChannels(guildID api.Snowflake, check func(u *api.VoiceChannel) bool) []*api.VoiceChannel
- func (c *CacheImpl) Guild(guildID api.Snowflake) *api.Guild
- func (c *CacheImpl) GuildCache() map[api.Snowflake]*api.Guild
- func (c *CacheImpl) GuildChannel(channelID api.Snowflake) *api.GuildChannel
- func (c *CacheImpl) Guilds() []*api.Guild
- func (c *CacheImpl) GuildsByName(name string, ignoreCase bool) []*api.Guild
- func (c *CacheImpl) Member(guildID api.Snowflake, userID api.Snowflake) *api.Member
- func (c *CacheImpl) MemberByTag(guildID api.Snowflake, tag string) *api.Member
- func (c *CacheImpl) MemberCache(guildID api.Snowflake) map[api.Snowflake]*api.Member
- func (c *CacheImpl) Members(guildID api.Snowflake) []*api.Member
- func (c *CacheImpl) MembersByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.Member
- func (c *CacheImpl) MessageChannel(channelID api.Snowflake) *api.MessageChannel
- func (c *CacheImpl) Role(guildID api.Snowflake, roleID api.Snowflake) *api.Role
- func (c *CacheImpl) RoleCache(guildID api.Snowflake) map[api.Snowflake]*api.Role
- func (c *CacheImpl) Roles(guildID api.Snowflake) []*api.Role
- func (c *CacheImpl) RolesByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.Role
- func (c *CacheImpl) StoreChannel(storeChannelID api.Snowflake) *api.StoreChannel
- func (c *CacheImpl) StoreChannelCache(guildID api.Snowflake) map[api.Snowflake]*api.StoreChannel
- func (c *CacheImpl) StoreChannels(guildID api.Snowflake) []*api.StoreChannel
- func (c *CacheImpl) StoreChannelsByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.StoreChannel
- func (c *CacheImpl) TextChannel(textChannelID api.Snowflake) *api.TextChannel
- func (c *CacheImpl) TextChannelCache(guildID api.Snowflake) map[api.Snowflake]*api.TextChannel
- func (c *CacheImpl) TextChannels(guildID api.Snowflake) []*api.TextChannel
- func (c *CacheImpl) TextChannelsByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.TextChannel
- func (c *CacheImpl) UncacheCategory(guildID api.Snowflake, categoryID api.Snowflake)
- func (c *CacheImpl) UncacheDMChannel(channelID api.Snowflake)
- func (c *CacheImpl) UncacheGuild(guildID api.Snowflake)
- func (c *CacheImpl) UncacheMember(guildID api.Snowflake, userID api.Snowflake)
- func (c *CacheImpl) UncacheRole(guildID api.Snowflake, roleID api.Snowflake)
- func (c *CacheImpl) UncacheStoreChannel(guildID api.Snowflake, storeChannelID api.Snowflake)
- func (c *CacheImpl) UncacheTextChannel(guildID api.Snowflake, textChannelID api.Snowflake)
- func (c *CacheImpl) UncacheUser(id api.Snowflake)
- func (c *CacheImpl) UncacheVoiceChannel(guildID api.Snowflake, voiceChannelID api.Snowflake)
- func (c *CacheImpl) User(id api.Snowflake) *api.User
- func (c *CacheImpl) UserByTag(tag string) *api.User
- func (c *CacheImpl) UserCache() map[api.Snowflake]*api.User
- func (c *CacheImpl) Users() []*api.User
- func (c *CacheImpl) UsersByName(name string, ignoreCase bool) []*api.User
- func (c *CacheImpl) VoiceChannel(voiceChannelID api.Snowflake) *api.VoiceChannel
- func (c *CacheImpl) VoiceChannelCache(guildID api.Snowflake) map[api.Snowflake]*api.VoiceChannel
- func (c *CacheImpl) VoiceChannels(guildID api.Snowflake) []*api.VoiceChannel
- func (c *CacheImpl) VoiceChannelsByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.VoiceChannel
- type DisgoBuilderImpl
- func (b DisgoBuilderImpl) AddEventListeners(eventListeners ...api.EventListener) api.DisgoBuilder
- func (b DisgoBuilderImpl) Build() (api.Disgo, error)
- func (b DisgoBuilderImpl) SetCache(cache api.Cache) api.DisgoBuilder
- func (b DisgoBuilderImpl) SetEventManager(eventManager api.EventManager) api.DisgoBuilder
- func (b DisgoBuilderImpl) SetGateway(gateway api.Gateway) api.DisgoBuilder
- func (b DisgoBuilderImpl) SetIntents(intents api.Intents) api.DisgoBuilder
- func (b DisgoBuilderImpl) SetLogLevel(logLevel log.Level) api.DisgoBuilder
- func (b DisgoBuilderImpl) SetMemberCachePolicy(memberCachePolicy api.MemberCachePolicy) api.DisgoBuilder
- func (b DisgoBuilderImpl) SetRestClient(restClient api.RestClient) api.DisgoBuilder
- func (b DisgoBuilderImpl) SetToken(token string) api.DisgoBuilder
- func (b DisgoBuilderImpl) SetWebhookServer(webhookServer api.WebhookServer) api.DisgoBuilder
- func (b DisgoBuilderImpl) SetWebhookServerProperties(listenURL string, listenPort int, publicKey string) api.DisgoBuilder
- type DisgoImpl
- func (d *DisgoImpl) ApplicationID() api.Snowflake
- func (d *DisgoImpl) Cache() api.Cache
- func (d *DisgoImpl) Close()
- func (d *DisgoImpl) Connect() error
- func (d DisgoImpl) CreateCommand(command api.SlashCommand) (*api.SlashCommand, error)
- func (d DisgoImpl) DeleteCommand(command api.SlashCommand) (*api.SlashCommand, error)
- func (d DisgoImpl) EditCommand(commandID api.Snowflake, command api.SlashCommand) (*api.SlashCommand, error)
- func (d *DisgoImpl) EventManager() api.EventManager
- func (d *DisgoImpl) Gateway() api.Gateway
- func (d DisgoImpl) GetCommand(commandID api.Snowflake) (*api.SlashCommand, error)
- func (d DisgoImpl) GetCommands() ([]*api.SlashCommand, error)
- func (d *DisgoImpl) HeartbeatLatency() time.Duration
- func (d *DisgoImpl) Intents() api.Intents
- func (d *DisgoImpl) RestClient() api.RestClient
- func (d *DisgoImpl) SelfUser() *api.User
- func (d DisgoImpl) SetCommands(commands ...api.SlashCommand) ([]*api.SlashCommand, error)
- func (d *DisgoImpl) SetSelfUser(user *api.User)
- func (d *DisgoImpl) Start() error
- func (d *DisgoImpl) Token() string
- func (d *DisgoImpl) WebhookServer() api.WebhookServer
- type EventManagerImpl
- type GatewayImpl
- type RestClientImpl
- func (r RestClientImpl) AddMember(guildID api.Snowflake, userID api.Snowflake, ...) (member *api.Member, err error)
- func (r RestClientImpl) AddMemberRole(guildID api.Snowflake, userID api.Snowflake, roleID api.Snowflake) (err error)
- func (r RestClientImpl) AddReaction(channelID api.Snowflake, messageID api.Snowflake, emoji string) error
- func (r RestClientImpl) Close()
- func (r RestClientImpl) CreateGlobalCommand(applicationID api.Snowflake, command api.SlashCommand) (rCommand *api.SlashCommand, err error)
- func (r RestClientImpl) CreateGuildGuildCommand(applicationID api.Snowflake, guildID api.Snowflake, command api.SlashCommand) (rCommand *api.SlashCommand, err error)
- func (r RestClientImpl) CreateRole(guildID api.Snowflake, role api.UpdateRole) (newRole *api.Role, err error)
- func (r RestClientImpl) DeleteFollowupMessage(applicationID api.Snowflake, interactionToken string, messageID api.Snowflake) error
- func (r RestClientImpl) DeleteGlobalCommand(applicationID api.Snowflake, commandID api.Snowflake) error
- func (r RestClientImpl) DeleteGuildCommand(applicationID api.Snowflake, guildID api.Snowflake, commandID api.Snowflake) error
- func (r RestClientImpl) DeleteInteractionResponse(applicationID api.Snowflake, interactionToken string) error
- func (r RestClientImpl) DeleteRole(guildID api.Snowflake, roleID api.Snowflake) (err error)
- func (r RestClientImpl) Disgo() api.Disgo
- func (r RestClientImpl) EditFollowupMessage(applicationID api.Snowflake, interactionToken string, messageID api.Snowflake, ...) (message *api.Message, err error)
- func (r RestClientImpl) EditGlobalCommand(applicationID api.Snowflake, commandID api.Snowflake, command api.SlashCommand) (rCommand *api.SlashCommand, err error)
- func (r RestClientImpl) EditGuildCommand(applicationID api.Snowflake, guildID api.Snowflake, commandID api.Snowflake, ...) (rCommand *api.SlashCommand, err error)
- func (r RestClientImpl) EditInteractionResponse(applicationID api.Snowflake, interactionToken string, ...) (message *api.Message, err error)
- func (r RestClientImpl) GetGlobalCommand(applicationID api.Snowflake, commandID api.Snowflake) (rCommand *api.SlashCommand, err error)
- func (r RestClientImpl) GetGlobalCommands(applicationID api.Snowflake) (commands []*api.SlashCommand, err error)
- func (r RestClientImpl) GetGuildCommand(applicationID api.Snowflake, guildID api.Snowflake, commandID api.Snowflake) (rCommand *api.SlashCommand, err error)
- func (r RestClientImpl) GetGuildCommands(applicationID api.Snowflake, guildID api.Snowflake) (commands []*api.SlashCommand, err error)
- func (r RestClientImpl) GetMember(guildID api.Snowflake, userID api.Snowflake) (member *api.Member, err error)
- func (r RestClientImpl) GetMembers(guildID api.Snowflake) (members []*api.Member, err error)
- func (r RestClientImpl) GetRoles(guildID api.Snowflake) (roles []*api.Role, err error)
- func (r RestClientImpl) GetUser(userID api.Snowflake) (user *api.User, err error)
- func (r RestClientImpl) KickMember(guildID api.Snowflake, userID api.Snowflake, reason *string) (err error)
- func (r RestClientImpl) MoveMember(guildID api.Snowflake, userID api.Snowflake, channelID *api.Snowflake) (member *api.Member, err error)
- func (r RestClientImpl) OpenDMChannel(userID api.Snowflake) (channel *api.DMChannel, err error)
- func (r RestClientImpl) RemoveMemberRole(guildID api.Snowflake, userID api.Snowflake, roleID api.Snowflake) (err error)
- func (r RestClientImpl) RemoveOwnReaction(channelID api.Snowflake, messageID api.Snowflake, emoji string) error
- func (r RestClientImpl) RemoveUserReaction(channelID api.Snowflake, messageID api.Snowflake, emoji string, ...) error
- func (r RestClientImpl) Request(route endpoints.CompiledAPIRoute, rqBody interface{}, rsBody interface{}) error
- func (r RestClientImpl) SendFollowupMessage(applicationID api.Snowflake, interactionToken string, ...) (message *api.Message, err error)
- func (r RestClientImpl) SendInteractionResponse(interactionID api.Snowflake, interactionToken string, ...) error
- func (r RestClientImpl) SendMessage(channelID api.Snowflake, message api.MessageCreate) (rMessage *api.Message, err error)
- func (r RestClientImpl) SetGlobalCommands(applicationID api.Snowflake, commands ...api.SlashCommand) (rCommands []*api.SlashCommand, err error)
- func (r RestClientImpl) SetGuildCommands(applicationID api.Snowflake, guildID api.Snowflake, ...) (rCommands []*api.SlashCommand, err error)
- func (r RestClientImpl) UpdateMember(guildID api.Snowflake, userID api.Snowflake, ...) (member *api.Member, err error)
- func (r RestClientImpl) UpdateRole(guildID api.Snowflake, roleID api.Snowflake, role api.UpdateRole) (newRole *api.Role, err error)
- func (r RestClientImpl) UpdateRolePositions(guildID api.Snowflake, roleUpdates ...api.UpdateRolePosition) (roles []*api.Role, err error)
- func (r RestClientImpl) UpdateSelfNick(guildID api.Snowflake, nick *string) (newNick *string, err error)
- func (r RestClientImpl) UserAgent() string
- type WebhookServerImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IDFromToken ¶
IDFromToken returns the applicationID from the token
func NewBuilder ¶
func NewBuilder(token string) api.DisgoBuilder
NewBuilder returns a new api.DisgoBuilder instance
Types ¶
type CacheImpl ¶
type CacheImpl struct {
// contains filtered or unexported fields
}
CacheImpl is used for Disgo's Cache
func (*CacheImpl) AllCategories ¶
AllCategories returns all categories from cache as a slice
func (*CacheImpl) AllCategoryCache ¶
AllCategoryCache returns all categories as a map of maps
func (*CacheImpl) AllMemberCache ¶
AllMemberCache returns the entire cache as a map of maps
func (*CacheImpl) AllMembers ¶
AllMembers returns the entire cache of members
func (*CacheImpl) AllRoleCache ¶
AllRoleCache returns the entire role cache
func (*CacheImpl) AllStoreChannelCache ¶
AllStoreChannelCache returns all store channels from cache as a map of maps
func (*CacheImpl) AllStoreChannels ¶
func (c *CacheImpl) AllStoreChannels() []*api.StoreChannel
AllStoreChannels returns all store channels from cache as a map
func (*CacheImpl) AllTextChannelCache ¶
AllTextChannelCache returns the text channel cache as a map of maps
func (*CacheImpl) AllTextChannels ¶
func (c *CacheImpl) AllTextChannels() []*api.TextChannel
AllTextChannels returns the text channel cache as a slice
func (*CacheImpl) AllVoiceChannelCache ¶
AllVoiceChannelCache returns all of the voice channels from cache as a map of maps
func (*CacheImpl) AllVoiceChannels ¶
func (c *CacheImpl) AllVoiceChannels() []*api.VoiceChannel
AllVoiceChannels returns all of the voice channels from cache as a slice
func (*CacheImpl) CacheCategory ¶
CacheCategory adds a category to the cache
func (*CacheImpl) CacheDMChannel ¶
CacheDMChannel adds a DM channel to the cache
func (*CacheImpl) CacheGuild ¶
CacheGuild adds a guild to the cache
func (*CacheImpl) CacheMember ¶
CacheMember adds a member to the cache
func (*CacheImpl) CacheStoreChannel ¶
func (c *CacheImpl) CacheStoreChannel(storeChannel *api.StoreChannel)
CacheStoreChannel adds a store channel to the cache
func (*CacheImpl) CacheTextChannel ¶
func (c *CacheImpl) CacheTextChannel(textChannel *api.TextChannel)
CacheTextChannel adds a channel to the cache
func (*CacheImpl) CacheVoiceChannel ¶
func (c *CacheImpl) CacheVoiceChannel(voiceChannel *api.VoiceChannel)
CacheVoiceChannel adds a voice channel to cache
func (*CacheImpl) Categories ¶
Categories returns the categories of a guild by ID
func (*CacheImpl) CategoriesByName ¶
func (c *CacheImpl) CategoriesByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.Category
CategoriesByName returns categories from cache by name
func (*CacheImpl) CategoryCache ¶
CategoryCache returns all categories from a guild's cache as a map
func (*CacheImpl) Close ¶
func (c *CacheImpl) Close()
Close cleans up the cache and it's internal tasks
func (*CacheImpl) DMChannelCache ¶
DMChannelCache returns the DM channels as a map
func (*CacheImpl) DMChannels ¶
DMChannels return all DM channels as a slice
func (*CacheImpl) DoCleanup ¶
func (c *CacheImpl) DoCleanup()
DoCleanup removes items from the cache that no longer meet their policy
func (*CacheImpl) FindCategories ¶
func (c *CacheImpl) FindCategories(guildID api.Snowflake, check func(u *api.Category) bool) []*api.Category
FindCategories finds categories in a guild by custom method
func (*CacheImpl) FindCategory ¶
func (c *CacheImpl) FindCategory(guildID api.Snowflake, check func(u *api.Category) bool) *api.Category
FindCategory finds a category in a guild by custom method
func (*CacheImpl) FindDMChannel ¶
FindDMChannel finds a DM channel in cache with a custom method
func (*CacheImpl) FindDMChannels ¶
FindDMChannels finds DM Channels in cache with a custom method
func (*CacheImpl) FindGuilds ¶
FindGuilds finds multiple guilds with a custom method
func (*CacheImpl) FindMember ¶
FindMember allows you to find a member in a guild by custom method
func (*CacheImpl) FindMembers ¶
func (c *CacheImpl) FindMembers(guildID api.Snowflake, check func(u *api.Member) bool) []*api.Member
FindMembers allows you to find api.Member(s) in a guild by custom method
func (*CacheImpl) FindStoreChannel ¶
func (c *CacheImpl) FindStoreChannel(guildID api.Snowflake, check func(u *api.StoreChannel) bool) *api.StoreChannel
FindStoreChannel returns a store channel from cache by custom method
func (*CacheImpl) FindStoreChannels ¶
func (c *CacheImpl) FindStoreChannels(guildID api.Snowflake, check func(u *api.StoreChannel) bool) []*api.StoreChannel
FindStoreChannels returns store channels from cache by custom method
func (*CacheImpl) FindTextChannel ¶
func (c *CacheImpl) FindTextChannel(guildID api.Snowflake, check func(u *api.TextChannel) bool) *api.TextChannel
FindTextChannel finds a text channel in a guild by custom method
func (*CacheImpl) FindTextChannels ¶
func (c *CacheImpl) FindTextChannels(guildID api.Snowflake, check func(u *api.TextChannel) bool) []*api.TextChannel
FindTextChannels finds text channels in a guild by custom method
func (*CacheImpl) FindVoiceChannel ¶
func (c *CacheImpl) FindVoiceChannel(guildID api.Snowflake, check func(u *api.VoiceChannel) bool) *api.VoiceChannel
FindVoiceChannel returns a voice channel from cache by custom method
func (*CacheImpl) FindVoiceChannels ¶
func (c *CacheImpl) FindVoiceChannels(guildID api.Snowflake, check func(u *api.VoiceChannel) bool) []*api.VoiceChannel
FindVoiceChannels returns voice channels from cache by custom method
func (*CacheImpl) GuildCache ¶
GuildCache returns the guild cache as a map
func (*CacheImpl) GuildChannel ¶
func (c *CacheImpl) GuildChannel(channelID api.Snowflake) *api.GuildChannel
GuildChannel returns a channel from a guild by ID
func (*CacheImpl) GuildsByName ¶
GuildsByName allows you to get guilds from the cache by name
func (*CacheImpl) MemberByTag ¶
MemberByTag returns a member from cache by guild ID and user tag
func (*CacheImpl) MemberCache ¶
MemberCache returns the cache of a guild as a map
func (*CacheImpl) MembersByName ¶
func (c *CacheImpl) MembersByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.Member
MembersByName returns members from cache by guild ID and username
func (*CacheImpl) MessageChannel ¶
func (c *CacheImpl) MessageChannel(channelID api.Snowflake) *api.MessageChannel
MessageChannel returns a channel from dm or text channel cache by ID
func (*CacheImpl) RolesByName ¶
RolesByName returns roles from cache by guild ID and name
func (*CacheImpl) StoreChannel ¶
func (c *CacheImpl) StoreChannel(storeChannelID api.Snowflake) *api.StoreChannel
StoreChannel returns a store channel from cache by ID
func (*CacheImpl) StoreChannelCache ¶
StoreChannelCache returns the store channels of a guild by ID
func (*CacheImpl) StoreChannels ¶
func (c *CacheImpl) StoreChannels(guildID api.Snowflake) []*api.StoreChannel
StoreChannels returns store channels from cache by guild ID
func (*CacheImpl) StoreChannelsByName ¶
func (c *CacheImpl) StoreChannelsByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.StoreChannel
StoreChannelsByName returns store channels from cache by name
func (*CacheImpl) TextChannel ¶
func (c *CacheImpl) TextChannel(textChannelID api.Snowflake) *api.TextChannel
TextChannel returns a text channel from cache by ID
func (*CacheImpl) TextChannelCache ¶
TextChannelCache returns the channel cache as a map
func (*CacheImpl) TextChannels ¶
func (c *CacheImpl) TextChannels(guildID api.Snowflake) []*api.TextChannel
TextChannels returns the text channel cache from a guild
func (*CacheImpl) TextChannelsByName ¶
func (c *CacheImpl) TextChannelsByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.TextChannel
TextChannelsByName returns text channel from cache by guild ID and name
func (*CacheImpl) UncacheCategory ¶
UncacheCategory removes a category from cache
func (*CacheImpl) UncacheDMChannel ¶
UncacheDMChannel removes a DM channel from cache
func (*CacheImpl) UncacheGuild ¶
UncacheGuild removes a guild and all of it's children from the cache
func (*CacheImpl) UncacheMember ¶
UncacheMember removes a guild member from the cache
func (*CacheImpl) UncacheRole ¶
UncacheRole removes a role from cache
func (*CacheImpl) UncacheStoreChannel ¶
UncacheStoreChannel removes a store channel from cache
func (*CacheImpl) UncacheTextChannel ¶
UncacheTextChannel removes a text channel from the cache
func (*CacheImpl) UncacheUser ¶
UncacheUser removes a user from the cache
func (*CacheImpl) UncacheVoiceChannel ¶
UncacheVoiceChannel removes a voice channel from cache
func (*CacheImpl) UsersByName ¶
UsersByName allows you to get users from the cache by username
func (*CacheImpl) VoiceChannel ¶
func (c *CacheImpl) VoiceChannel(voiceChannelID api.Snowflake) *api.VoiceChannel
VoiceChannel returns a voice channel from cache by ID
func (*CacheImpl) VoiceChannelCache ¶
VoiceChannelCache returns all of the voice channels from cache as a map
func (*CacheImpl) VoiceChannels ¶
func (c *CacheImpl) VoiceChannels(guildID api.Snowflake) []*api.VoiceChannel
VoiceChannels returns voice channels from a guild's cache
func (*CacheImpl) VoiceChannelsByName ¶
func (c *CacheImpl) VoiceChannelsByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.VoiceChannel
VoiceChannelsByName returns voice channels from cache by name
type DisgoBuilderImpl ¶
type DisgoBuilderImpl struct {
// contains filtered or unexported fields
}
DisgoBuilderImpl implementation of the api.DisgoBuilder interface
func (DisgoBuilderImpl) AddEventListeners ¶
func (b DisgoBuilderImpl) AddEventListeners(eventListeners ...api.EventListener) api.DisgoBuilder
AddEventListeners lets you add an api.EventListener to your api.EventManager
func (DisgoBuilderImpl) Build ¶
func (b DisgoBuilderImpl) Build() (api.Disgo, error)
Build builds your api.Disgo instance
func (DisgoBuilderImpl) SetCache ¶
func (b DisgoBuilderImpl) SetCache(cache api.Cache) api.DisgoBuilder
SetCache lets you inject your own api.Cache
func (DisgoBuilderImpl) SetEventManager ¶
func (b DisgoBuilderImpl) SetEventManager(eventManager api.EventManager) api.DisgoBuilder
SetEventManager lets you inject your own api.EventManager
func (DisgoBuilderImpl) SetGateway ¶
func (b DisgoBuilderImpl) SetGateway(gateway api.Gateway) api.DisgoBuilder
SetGateway lets you inject your own api.Gateway
func (DisgoBuilderImpl) SetIntents ¶
func (b DisgoBuilderImpl) SetIntents(intents api.Intents) api.DisgoBuilder
SetIntents sets the api.Intents to connect to discord
func (DisgoBuilderImpl) SetLogLevel ¶
func (b DisgoBuilderImpl) SetLogLevel(logLevel log.Level) api.DisgoBuilder
SetLogLevel sets logrus.Level of logrus
func (DisgoBuilderImpl) SetMemberCachePolicy ¶
func (b DisgoBuilderImpl) SetMemberCachePolicy(memberCachePolicy api.MemberCachePolicy) api.DisgoBuilder
SetMemberCachePolicy lets oyu set your own api.MemberCachePolicy
func (DisgoBuilderImpl) SetRestClient ¶
func (b DisgoBuilderImpl) SetRestClient(restClient api.RestClient) api.DisgoBuilder
SetRestClient lets you inject your own api.RestClient
func (DisgoBuilderImpl) SetToken ¶
func (b DisgoBuilderImpl) SetToken(token string) api.DisgoBuilder
SetToken sets the token to connect to discord
func (DisgoBuilderImpl) SetWebhookServer ¶
func (b DisgoBuilderImpl) SetWebhookServer(webhookServer api.WebhookServer) api.DisgoBuilder
SetWebhookServer lets you inject your own api.EventManager
func (DisgoBuilderImpl) SetWebhookServerProperties ¶
func (b DisgoBuilderImpl) SetWebhookServerProperties(listenURL string, listenPort int, publicKey string) api.DisgoBuilder
SetWebhookServerProperties sets the default api.WebhookServer properties
type DisgoImpl ¶
type DisgoImpl struct {
// contains filtered or unexported fields
}
DisgoImpl is the main discord client
func (*DisgoImpl) ApplicationID ¶
ApplicationID returns the current application id
func (*DisgoImpl) Close ¶
func (d *DisgoImpl) Close()
Close will cleanup all disgo internals and close the discord connection safely
func (DisgoImpl) CreateCommand ¶
func (d DisgoImpl) CreateCommand(command api.SlashCommand) (*api.SlashCommand, error)
CreateCommand creates a new command for this guild
func (DisgoImpl) DeleteCommand ¶
func (d DisgoImpl) DeleteCommand(command api.SlashCommand) (*api.SlashCommand, error)
DeleteCommand creates a new command for this guild
func (DisgoImpl) EditCommand ¶
func (d DisgoImpl) EditCommand(commandID api.Snowflake, command api.SlashCommand) (*api.SlashCommand, error)
EditCommand edits a specific guild command
func (*DisgoImpl) EventManager ¶
func (d *DisgoImpl) EventManager() api.EventManager
EventManager returns the api.EventManager
func (DisgoImpl) GetCommand ¶
GetCommand fetches a specific guild command
func (DisgoImpl) GetCommands ¶
func (d DisgoImpl) GetCommands() ([]*api.SlashCommand, error)
GetCommands fetches all guild commands
func (*DisgoImpl) HeartbeatLatency ¶
HeartbeatLatency returns the heartbeat latency
func (*DisgoImpl) Intents ¶
Intents returns the Intents originally specified when creating the client
func (*DisgoImpl) RestClient ¶
func (d *DisgoImpl) RestClient() api.RestClient
RestClient returns the HTTP client used by disgo
func (DisgoImpl) SetCommands ¶
func (d DisgoImpl) SetCommands(commands ...api.SlashCommand) ([]*api.SlashCommand, error)
SetCommands overrides all commands for this guild
func (*DisgoImpl) SetSelfUser ¶
SetSelfUser sets the self user
func (*DisgoImpl) WebhookServer ¶
func (d *DisgoImpl) WebhookServer() api.WebhookServer
WebhookServer returns the api.EventManager
type EventManagerImpl ¶
type EventManagerImpl struct {
// contains filtered or unexported fields
}
EventManagerImpl is the implementation of api.EventManager
func (EventManagerImpl) AddEventListeners ¶
func (e EventManagerImpl) AddEventListeners(listeners ...api.EventListener)
AddEventListeners adds one or more api.EventListener(s) to the api.EventManager
func (EventManagerImpl) Dispatch ¶
func (e EventManagerImpl) Dispatch(event api.GenericEvent)
Dispatch dispatches a new event to the client
func (EventManagerImpl) Handle ¶
func (e EventManagerImpl) Handle(name string, payload json.RawMessage, c chan interface{})
Handle calls the correct api.EventHandler
func (EventManagerImpl) ListenEvents ¶
func (e EventManagerImpl) ListenEvents()
ListenEvents starts the event goroutine
type GatewayImpl ¶
type GatewayImpl struct {
// contains filtered or unexported fields
}
GatewayImpl is what is used to connect to discord
func (*GatewayImpl) Disgo ¶
func (g *GatewayImpl) Disgo() api.Disgo
Disgo returns the gateway's disgo client
func (*GatewayImpl) Latency ¶
func (g *GatewayImpl) Latency() time.Duration
Latency returns the api.Gateway latency
func (*GatewayImpl) Open ¶
func (g *GatewayImpl) Open() error
Open initializes the client and connection to discord
func (*GatewayImpl) Status ¶
func (g *GatewayImpl) Status() api.ConnectionStatus
Status returns the gateway connection status
type RestClientImpl ¶
RestClientImpl is the rest client implementation used for HTTP requests to discord
func (RestClientImpl) AddMember ¶
func (r RestClientImpl) AddMember(guildID api.Snowflake, userID api.Snowflake, addGuildMemberData api.AddGuildMemberData) (member *api.Member, err error)
AddMember adds a member to the guild with the oauth2 access token. requires api.PermissionCreateInstantInvite
func (RestClientImpl) AddMemberRole ¶
func (r RestClientImpl) AddMemberRole(guildID api.Snowflake, userID api.Snowflake, roleID api.Snowflake) (err error)
AddMemberRole adds a role to a member
func (RestClientImpl) AddReaction ¶
func (r RestClientImpl) AddReaction(channelID api.Snowflake, messageID api.Snowflake, emoji string) error
AddReaction lets you add a reaction to a message_events
func (RestClientImpl) Close ¶
func (r RestClientImpl) Close()
Close cleans up the http managers connections
func (RestClientImpl) CreateGlobalCommand ¶
func (r RestClientImpl) CreateGlobalCommand(applicationID api.Snowflake, command api.SlashCommand) (rCommand *api.SlashCommand, err error)
CreateGlobalCommand lets you create a new global command
func (RestClientImpl) CreateGuildGuildCommand ¶
func (r RestClientImpl) CreateGuildGuildCommand(applicationID api.Snowflake, guildID api.Snowflake, command api.SlashCommand) (rCommand *api.SlashCommand, err error)
CreateGuildGuildCommand lets you create a new guild_events command
func (RestClientImpl) CreateRole ¶
func (r RestClientImpl) CreateRole(guildID api.Snowflake, role api.UpdateRole) (newRole *api.Role, err error)
CreateRole creates a new role for a guild. Requires api.PermissionManageRoles
func (RestClientImpl) DeleteFollowupMessage ¶
func (r RestClientImpl) DeleteFollowupMessage(applicationID api.Snowflake, interactionToken string, messageID api.Snowflake) error
DeleteFollowupMessage used to send a followup message_events to an interaction
func (RestClientImpl) DeleteGlobalCommand ¶
func (r RestClientImpl) DeleteGlobalCommand(applicationID api.Snowflake, commandID api.Snowflake) error
DeleteGlobalCommand lets you delete a specific global command
func (RestClientImpl) DeleteGuildCommand ¶
func (r RestClientImpl) DeleteGuildCommand(applicationID api.Snowflake, guildID api.Snowflake, commandID api.Snowflake) error
DeleteGuildCommand lets you delete a specific guild_events command
func (RestClientImpl) DeleteInteractionResponse ¶
func (r RestClientImpl) DeleteInteractionResponse(applicationID api.Snowflake, interactionToken string) error
DeleteInteractionResponse used to delete the initial response on an interaction
func (RestClientImpl) DeleteRole ¶
DeleteRole deletes a role from a guild. Requires api.PermissionManageRoles
func (RestClientImpl) Disgo ¶
func (r RestClientImpl) Disgo() api.Disgo
Disgo returns the api.Disgo instance
func (RestClientImpl) EditFollowupMessage ¶
func (r RestClientImpl) EditFollowupMessage(applicationID api.Snowflake, interactionToken string, messageID api.Snowflake, followupMessage api.FollowupMessage) (message *api.Message, err error)
EditFollowupMessage used to send the initial response on an interaction
func (RestClientImpl) EditGlobalCommand ¶
func (r RestClientImpl) EditGlobalCommand(applicationID api.Snowflake, commandID api.Snowflake, command api.SlashCommand) (rCommand *api.SlashCommand, err error)
EditGlobalCommand lets you edit a specific global command
func (RestClientImpl) EditGuildCommand ¶
func (r RestClientImpl) EditGuildCommand(applicationID api.Snowflake, guildID api.Snowflake, commandID api.Snowflake, command api.SlashCommand) (rCommand *api.SlashCommand, err error)
EditGuildCommand lets you edit a specific guild_events command
func (RestClientImpl) EditInteractionResponse ¶
func (r RestClientImpl) EditInteractionResponse(applicationID api.Snowflake, interactionToken string, interactionResponse api.InteractionResponse) (message *api.Message, err error)
EditInteractionResponse used to edit the initial response on an interaction
func (RestClientImpl) GetGlobalCommand ¶
func (r RestClientImpl) GetGlobalCommand(applicationID api.Snowflake, commandID api.Snowflake) (rCommand *api.SlashCommand, err error)
GetGlobalCommand gets you a specific global global command
func (RestClientImpl) GetGlobalCommands ¶
func (r RestClientImpl) GetGlobalCommands(applicationID api.Snowflake) (commands []*api.SlashCommand, err error)
GetGlobalCommands gets you all global commands
func (RestClientImpl) GetGuildCommand ¶
func (r RestClientImpl) GetGuildCommand(applicationID api.Snowflake, guildID api.Snowflake, commandID api.Snowflake) (rCommand *api.SlashCommand, err error)
GetGuildCommand gets you a specific guild_events command
func (RestClientImpl) GetGuildCommands ¶
func (r RestClientImpl) GetGuildCommands(applicationID api.Snowflake, guildID api.Snowflake) (commands []*api.SlashCommand, err error)
GetGuildCommands gets you all guild_events commands
func (RestClientImpl) GetMember ¶
func (r RestClientImpl) GetMember(guildID api.Snowflake, userID api.Snowflake) (member *api.Member, err error)
GetMember fetches the specific member
func (RestClientImpl) GetMembers ¶
GetMembers fetches all members for a guild
func (RestClientImpl) KickMember ¶
func (r RestClientImpl) KickMember(guildID api.Snowflake, userID api.Snowflake, reason *string) (err error)
KickMember kicks a member from the guild. requires api.PermissionKickMembers
func (RestClientImpl) MoveMember ¶
func (r RestClientImpl) MoveMember(guildID api.Snowflake, userID api.Snowflake, channelID *api.Snowflake) (member *api.Member, err error)
MoveMember moves/kicks the member to/from a voice channel
func (RestClientImpl) OpenDMChannel ¶
OpenDMChannel opens a new dm channel a user
func (RestClientImpl) RemoveMemberRole ¶
func (r RestClientImpl) RemoveMemberRole(guildID api.Snowflake, userID api.Snowflake, roleID api.Snowflake) (err error)
RemoveMemberRole removes a role from a member
func (RestClientImpl) RemoveOwnReaction ¶
func (r RestClientImpl) RemoveOwnReaction(channelID api.Snowflake, messageID api.Snowflake, emoji string) error
RemoveOwnReaction lets you remove your own reaction from a message_events
func (RestClientImpl) RemoveUserReaction ¶
func (r RestClientImpl) RemoveUserReaction(channelID api.Snowflake, messageID api.Snowflake, emoji string, userID api.Snowflake) error
RemoveUserReaction lets you remove a specific reaction from a user from a message_events
func (RestClientImpl) Request ¶
func (r RestClientImpl) Request(route endpoints.CompiledAPIRoute, rqBody interface{}, rsBody interface{}) error
Request makes a new rest request to discords api with the specific endpoints.APIRoute
func (RestClientImpl) SendFollowupMessage ¶
func (r RestClientImpl) SendFollowupMessage(applicationID api.Snowflake, interactionToken string, followupMessage api.FollowupMessage) (message *api.Message, err error)
SendFollowupMessage used to send a followup message_events to an interaction
func (RestClientImpl) SendInteractionResponse ¶
func (r RestClientImpl) SendInteractionResponse(interactionID api.Snowflake, interactionToken string, interactionResponse api.InteractionResponse) error
SendInteractionResponse used to send the initial response on an interaction
func (RestClientImpl) SendMessage ¶
func (r RestClientImpl) SendMessage(channelID api.Snowflake, message api.MessageCreate) (rMessage *api.Message, err error)
SendMessage lets you send a message_events to a channel
func (RestClientImpl) SetGlobalCommands ¶
func (r RestClientImpl) SetGlobalCommands(applicationID api.Snowflake, commands ...api.SlashCommand) (rCommands []*api.SlashCommand, err error)
SetGlobalCommands lets you override all global commands
func (RestClientImpl) SetGuildCommands ¶
func (r RestClientImpl) SetGuildCommands(applicationID api.Snowflake, guildID api.Snowflake, commands ...api.SlashCommand) (rCommands []*api.SlashCommand, err error)
SetGuildCommands lets you override all guild_events commands
func (RestClientImpl) UpdateMember ¶
func (r RestClientImpl) UpdateMember(guildID api.Snowflake, userID api.Snowflake, updateGuildMemberData api.UpdateGuildMemberData) (member *api.Member, err error)
UpdateMember updates a member
func (RestClientImpl) UpdateRole ¶
func (r RestClientImpl) UpdateRole(guildID api.Snowflake, roleID api.Snowflake, role api.UpdateRole) (newRole *api.Role, err error)
UpdateRole updates a role from a guild. Requires api.PermissionManageRoles
func (RestClientImpl) UpdateRolePositions ¶
func (r RestClientImpl) UpdateRolePositions(guildID api.Snowflake, roleUpdates ...api.UpdateRolePosition) (roles []*api.Role, err error)
UpdateRolePositions updates the position of a role from a guild. Requires api.PermissionManageRoles
func (RestClientImpl) UpdateSelfNick ¶
func (r RestClientImpl) UpdateSelfNick(guildID api.Snowflake, nick *string) (newNick *string, err error)
UpdateSelfNick updates the bots nickname in a guild
func (RestClientImpl) UserAgent ¶
func (r RestClientImpl) UserAgent() string
UserAgent returns the user agent for this api.RestClient
type WebhookServerImpl ¶
type WebhookServerImpl struct {
// contains filtered or unexported fields
}
WebhookServerImpl is used in Disgo's webhook server for interactions
func (*WebhookServerImpl) Close ¶
func (w *WebhookServerImpl) Close()
Close shuts down the WebhookServerImpl
func (*WebhookServerImpl) Disgo ¶
func (w *WebhookServerImpl) Disgo() api.Disgo
Disgo returns the Disgo client
func (*WebhookServerImpl) ListenURL ¶
func (w *WebhookServerImpl) ListenURL() string
ListenURL returns the URL that the server is listening on
func (*WebhookServerImpl) PublicKey ¶
func (w *WebhookServerImpl) PublicKey() ed25519.PublicKey
PublicKey returns the public key to verify the discord requests with
func (*WebhookServerImpl) Router ¶
func (w *WebhookServerImpl) Router() *mux.Router
Router returns the mux router used on the webhook server
func (*WebhookServerImpl) Start ¶
func (w *WebhookServerImpl) Start() error
Start makes the WebhookServerImpl listen on the specified port and handle requests