internal

package
v0.5.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDFromToken

func IDFromToken(token string) (*api.Snowflake, error)

IDFromToken returns the applicationID from the BotToken

func New

func New(token string, options api.Options) (api.Disgo, error)

New creates a new api.Disgo instance

func NewBuilder

func NewBuilder(token string) api.DisgoBuilder

NewBuilder returns a new api.DisgoBuilder instance

Types

type AudioControllerImpl added in v0.2.0

type AudioControllerImpl struct {
	// contains filtered or unexported fields
}

AudioControllerImpl lets you Connect / Disconnect from an api.VoiceChannel

func (*AudioControllerImpl) Connect added in v0.2.0

func (c *AudioControllerImpl) Connect(guildID api.Snowflake, channelID api.Snowflake) error

Connect sends an api.GatewayCommand to connect to an api.VoiceChannel

func (*AudioControllerImpl) Disconnect added in v0.2.0

func (c *AudioControllerImpl) Disconnect(guildID api.Snowflake) error

Disconnect sends an api.GatewayCommand to disconnect from an api.VoiceChannel

func (*AudioControllerImpl) Disgo added in v0.2.0

func (c *AudioControllerImpl) Disgo() api.Disgo

Disgo returns the api.Disgo instance

type CacheImpl

type CacheImpl struct {
	// contains filtered or unexported fields
}

CacheImpl is used for api.Disgo's api.Cache

func (*CacheImpl) AllCategories

func (c *CacheImpl) AllCategories() []*api.Category

AllCategories returns all categories from cache as a slice

func (*CacheImpl) AllCategoryCache

func (c *CacheImpl) AllCategoryCache() map[api.Snowflake]map[api.Snowflake]*api.Category

AllCategoryCache returns all categories as a map of maps

func (*CacheImpl) AllEmoteCache added in v0.2.0

func (c *CacheImpl) AllEmoteCache() map[api.Snowflake]map[api.Snowflake]*api.Emoji

AllEmoteCache returns the full emote cache

func (*CacheImpl) AllGuildCommandCache added in v0.2.0

func (c *CacheImpl) AllGuildCommandCache() map[api.Snowflake]map[api.Snowflake]*api.Command

AllGuildCommandCache returns the cache of all Guild Command(s)

func (*CacheImpl) AllMemberCache

func (c *CacheImpl) AllMemberCache() map[api.Snowflake]map[api.Snowflake]*api.Member

AllMemberCache returns the entire cache as a map of maps

func (*CacheImpl) AllMembers

func (c *CacheImpl) AllMembers() []*api.Member

AllMembers returns the entire cache of members

func (*CacheImpl) AllMessageCache added in v0.2.0

func (c *CacheImpl) AllMessageCache() map[api.Snowflake]map[api.Snowflake]*api.Message

AllMessageCache returns the entire cache of messages

func (*CacheImpl) AllRoleCache

func (c *CacheImpl) AllRoleCache() map[api.Snowflake]map[api.Snowflake]*api.Role

AllRoleCache returns the entire role cache

func (*CacheImpl) AllRoles

func (c *CacheImpl) AllRoles() []*api.Role

AllRoles returns the entire role cache

func (*CacheImpl) AllStoreChannelCache

func (c *CacheImpl) AllStoreChannelCache() map[api.Snowflake]map[api.Snowflake]*api.StoreChannel

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

func (c *CacheImpl) AllTextChannelCache() map[api.Snowflake]map[api.Snowflake]*api.TextChannel

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

func (c *CacheImpl) AllVoiceChannelCache() map[api.Snowflake]map[api.Snowflake]*api.VoiceChannel

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

func (c *CacheImpl) CacheCategory(category *api.Category) *api.Category

CacheCategory adds a category to the cache

func (*CacheImpl) CacheDMChannel

func (c *CacheImpl) CacheDMChannel(dmChannel *api.DMChannel) *api.DMChannel

CacheDMChannel adds a DM channel to the cache

func (*CacheImpl) CacheEmote added in v0.2.0

func (c *CacheImpl) CacheEmote(emote *api.Emoji) *api.Emoji

CacheEmote adds an Emote to the api.Cache if emoji caches are used

func (CacheImpl) CacheFlags added in v0.2.0

func (c CacheImpl) CacheFlags() api.CacheFlags

CacheFlags returns the current active api.CacheFlags

func (*CacheImpl) CacheGlobalCommand added in v0.2.0

func (c *CacheImpl) CacheGlobalCommand(command *api.Command) *api.Command

CacheGlobalCommand adds a global command to the cache

func (*CacheImpl) CacheGuild

func (c *CacheImpl) CacheGuild(guild *api.Guild) *api.Guild

CacheGuild adds a guild to the cache

func (*CacheImpl) CacheGuildCommand added in v0.2.0

func (c *CacheImpl) CacheGuildCommand(command *api.Command) *api.Command

CacheGuildCommand adds a Guild Command to the cache

func (*CacheImpl) CacheMember

func (c *CacheImpl) CacheMember(member *api.Member) *api.Member

CacheMember adds a member to the cache

func (*CacheImpl) CacheMessage added in v0.2.0

func (c *CacheImpl) CacheMessage(message *api.Message) *api.Message

CacheMessage adds a message to the cache

func (*CacheImpl) CacheRole

func (c *CacheImpl) CacheRole(role *api.Role) *api.Role

CacheRole adds a role to the cache

func (*CacheImpl) CacheStoreChannel

func (c *CacheImpl) CacheStoreChannel(storeChannel *api.StoreChannel) *api.StoreChannel

CacheStoreChannel adds a store channel to the cache

func (*CacheImpl) CacheTextChannel

func (c *CacheImpl) CacheTextChannel(textChannel *api.TextChannel) *api.TextChannel

CacheTextChannel adds a channel to the cache

func (*CacheImpl) CacheUser

func (c *CacheImpl) CacheUser(user *api.User) *api.User

CacheUser adds a user to the cache

func (*CacheImpl) CacheVoiceChannel

func (c *CacheImpl) CacheVoiceChannel(voiceChannel *api.VoiceChannel) *api.VoiceChannel

CacheVoiceChannel adds a voice channel to cache

func (*CacheImpl) CacheVoiceState added in v0.2.0

func (c *CacheImpl) CacheVoiceState(voiceState *api.VoiceState) *api.VoiceState

CacheVoiceState adds an api.VoiceState from the api.Cache

func (*CacheImpl) Categories

func (c *CacheImpl) Categories(guildID api.Snowflake) []*api.Category

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) Category

func (c *CacheImpl) Category(categoryID api.Snowflake) *api.Category

Category returns a category from cache by ID

func (*CacheImpl) CategoryCache

func (c *CacheImpl) CategoryCache(guildID api.Snowflake) map[api.Snowflake]*api.Category

CategoryCache returns all categories from a guild's cache as a map

func (*CacheImpl) Channel

func (c *CacheImpl) Channel(channelID api.Snowflake) *api.Channel

Channel returns a channel from any channel cache by ID

func (*CacheImpl) Close

func (c *CacheImpl) Close()

Close cleans up the cache and it's internal tasks

func (*CacheImpl) Command added in v0.2.0

func (c *CacheImpl) Command(commandID api.Snowflake) *api.Command

Command returns an api.Command from cache

func (*CacheImpl) DMChannel

func (c *CacheImpl) DMChannel(dmChannelID api.Snowflake) *api.DMChannel

DMChannel returns a DM channel by ID

func (*CacheImpl) DMChannelCache

func (c *CacheImpl) DMChannelCache() map[api.Snowflake]*api.DMChannel

DMChannelCache returns the DM channels as a map

func (*CacheImpl) DMChannels

func (c *CacheImpl) DMChannels() []*api.DMChannel

DMChannels return all DM channels as a slice

func (*CacheImpl) Disgo added in v0.2.0

func (c *CacheImpl) Disgo() api.Disgo

Disgo returns the current api.Disgo instance

func (*CacheImpl) DoCleanup

func (c *CacheImpl) DoCleanup()

DoCleanup removes items from the cache that no longer meet their policy

func (*CacheImpl) Emote added in v0.2.0

func (c *CacheImpl) Emote(emoteID api.Snowflake) *api.Emoji

Emote returns a specific emote from the cache

func (*CacheImpl) EmoteCache added in v0.2.0

func (c *CacheImpl) EmoteCache(guildID api.Snowflake) map[api.Snowflake]*api.Emoji

EmoteCache returns the emote cache for a specific guild

func (*CacheImpl) Emotes added in v0.2.0

func (c *CacheImpl) Emotes(guildID api.Snowflake) []*api.Emoji

Emotes returns all cached emotes for a guild

func (*CacheImpl) EmotesByName added in v0.2.0

func (c *CacheImpl) EmotesByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.Emoji

EmotesByName returns all emotes for a guild by name

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

func (c *CacheImpl) FindDMChannel(check func(u *api.DMChannel) bool) *api.DMChannel

FindDMChannel finds a DM channel in cache with a custom method

func (*CacheImpl) FindDMChannels

func (c *CacheImpl) FindDMChannels(check func(u *api.DMChannel) bool) []*api.DMChannel

FindDMChannels finds DM Channels in cache with a custom method

func (*CacheImpl) FindGuild

func (c *CacheImpl) FindGuild(check func(g *api.Guild) bool) *api.Guild

FindGuild finds a guild by a custom method

func (*CacheImpl) FindGuilds

func (c *CacheImpl) FindGuilds(check func(g *api.Guild) bool) []*api.Guild

FindGuilds finds multiple guilds with a custom method

func (*CacheImpl) FindMember

func (c *CacheImpl) FindMember(guildID api.Snowflake, check func(u *api.Member) bool) *api.Member

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) FindRole

func (c *CacheImpl) FindRole(guildID api.Snowflake, check func(u *api.Role) bool) *api.Role

FindRole allows you to find a role in a guild by custom method

func (*CacheImpl) FindRoles

func (c *CacheImpl) FindRoles(guildID api.Snowflake, check func(u *api.Role) bool) []*api.Role

FindRoles allows you to find roles 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) FindUser

func (c *CacheImpl) FindUser(check func(u *api.User) bool) *api.User

FindUser finds a user from the cache with a custom method

func (*CacheImpl) FindUsers

func (c *CacheImpl) FindUsers(check func(u *api.User) bool) []*api.User

FindUsers finds several users from the cache with a 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) GlobalCommandCache added in v0.2.0

func (c *CacheImpl) GlobalCommandCache() map[api.Snowflake]*api.Command

GlobalCommandCache returns the cache of global Command(s)

func (*CacheImpl) Guild

func (c *CacheImpl) Guild(guildID api.Snowflake) *api.Guild

Guild allows you to get a guild from the cache by ID

func (*CacheImpl) GuildCache

func (c *CacheImpl) GuildCache() map[api.Snowflake]*api.Guild

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) GuildCommandCache added in v0.2.0

func (c *CacheImpl) GuildCommandCache(guildID api.Snowflake) map[api.Snowflake]*api.Command

GuildCommandCache returns the cache of commands in a Guild

func (*CacheImpl) Guilds

func (c *CacheImpl) Guilds() []*api.Guild

Guilds returns the guild cache as a slice

func (*CacheImpl) GuildsByName

func (c *CacheImpl) GuildsByName(name string, ignoreCase bool) []*api.Guild

GuildsByName allows you to get guilds from the cache by name

func (*CacheImpl) Member

func (c *CacheImpl) Member(guildID api.Snowflake, userID api.Snowflake) *api.Member

Member returns a member from cache by guild ID and user ID

func (*CacheImpl) MemberByTag

func (c *CacheImpl) MemberByTag(guildID api.Snowflake, tag string) *api.Member

MemberByTag returns a member from cache by guild ID and user tag

func (*CacheImpl) MemberCache

func (c *CacheImpl) MemberCache(guildID api.Snowflake) map[api.Snowflake]*api.Member

MemberCache returns the cache of a guild as a map

func (*CacheImpl) Members

func (c *CacheImpl) Members(guildID api.Snowflake) []*api.Member

Members returns the member cache of a guild by snowflake

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) Message added in v0.2.0

func (c *CacheImpl) Message(channelID api.Snowflake, messageID api.Snowflake) *api.Message

Message returns a message from cache

func (*CacheImpl) MessageCache added in v0.2.0

func (c *CacheImpl) MessageCache(channelID api.Snowflake) map[api.Snowflake]*api.Message

MessageCache returns the entire cache of Message(s) for a Channel

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) Messages added in v0.2.0

func (c *CacheImpl) Messages(channelID api.Snowflake) []*api.Message

Messages returns the messages of a channel from cache

func (*CacheImpl) Role

func (c *CacheImpl) Role(roleID api.Snowflake) *api.Role

Role returns a role from cache by guild ID and role ID

func (*CacheImpl) RoleCache

func (c *CacheImpl) RoleCache(guildID api.Snowflake) map[api.Snowflake]*api.Role

RoleCache returns the role cache of a guild by ID

func (*CacheImpl) Roles

func (c *CacheImpl) Roles(guildID api.Snowflake) []*api.Role

Roles returns the role cache of a guild

func (*CacheImpl) RolesByName

func (c *CacheImpl) RolesByName(guildID api.Snowflake, name string, ignoreCase bool) []*api.Role

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

func (c *CacheImpl) StoreChannelCache(guildID api.Snowflake) map[api.Snowflake]*api.StoreChannel

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

func (c *CacheImpl) TextChannelCache(guildID api.Snowflake) map[api.Snowflake]*api.TextChannel

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

func (c *CacheImpl) UncacheCategory(guildID api.Snowflake, categoryID api.Snowflake)

UncacheCategory removes a category from cache

func (*CacheImpl) UncacheCommand added in v0.2.0

func (c *CacheImpl) UncacheCommand(commandID api.Snowflake)

UncacheCommand removes a global Command from the cache

func (*CacheImpl) UncacheDMChannel

func (c *CacheImpl) UncacheDMChannel(dmChannelID api.Snowflake)

UncacheDMChannel removes a DM channel from cache

func (*CacheImpl) UncacheEmote added in v0.2.0

func (c *CacheImpl) UncacheEmote(guildID api.Snowflake, emoteID api.Snowflake)

UncacheEmote removes an Emote from api.Cache

func (*CacheImpl) UncacheGuild

func (c *CacheImpl) UncacheGuild(guildID api.Snowflake)

UncacheGuild removes a guild and all of it's children from the cache

func (*CacheImpl) UncacheMember

func (c *CacheImpl) UncacheMember(guildID api.Snowflake, userID api.Snowflake)

UncacheMember removes a guild member from the cache

func (*CacheImpl) UncacheMessage added in v0.2.0

func (c *CacheImpl) UncacheMessage(channelID api.Snowflake, messageID api.Snowflake)

UncacheMessage removes a Message from the cache if the cache policy allows it

func (*CacheImpl) UncacheRole

func (c *CacheImpl) UncacheRole(guildID api.Snowflake, roleID api.Snowflake)

UncacheRole removes a role from cache

func (*CacheImpl) UncacheStoreChannel

func (c *CacheImpl) UncacheStoreChannel(guildID api.Snowflake, storeChannelID api.Snowflake)

UncacheStoreChannel removes a store channel from cache

func (*CacheImpl) UncacheTextChannel

func (c *CacheImpl) UncacheTextChannel(guildID api.Snowflake, textChannelID api.Snowflake)

UncacheTextChannel removes a text channel from the cache

func (*CacheImpl) UncacheUser

func (c *CacheImpl) UncacheUser(id api.Snowflake)

UncacheUser removes a user from the cache

func (*CacheImpl) UncacheVoiceChannel

func (c *CacheImpl) UncacheVoiceChannel(guildID api.Snowflake, voiceChannelID api.Snowflake)

UncacheVoiceChannel removes a voice channel from cache

func (*CacheImpl) UncacheVoiceState added in v0.2.0

func (c *CacheImpl) UncacheVoiceState(guildID api.Snowflake, userID api.Snowflake)

UncacheVoiceState removes an api.VoiceState from the api.Cache

func (*CacheImpl) User

func (c *CacheImpl) User(id api.Snowflake) *api.User

User allows you to get a user from the cache by ID

func (*CacheImpl) UserByTag

func (c *CacheImpl) UserByTag(tag string) *api.User

UserByTag allows you to get a user from the cache by their Tag

func (*CacheImpl) UserCache

func (c *CacheImpl) UserCache() map[api.Snowflake]*api.User

UserCache returns all users from the cache a map

func (*CacheImpl) Users

func (c *CacheImpl) Users() []*api.User

Users returns all users from the cache as a slice

func (*CacheImpl) UsersByName

func (c *CacheImpl) UsersByName(name string, ignoreCase bool) []*api.User

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

func (c *CacheImpl) VoiceChannelCache(guildID api.Snowflake) map[api.Snowflake]*api.VoiceChannel

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

func (*CacheImpl) VoiceState added in v0.2.0

func (c *CacheImpl) VoiceState(guildID api.Snowflake, userID api.Snowflake) *api.VoiceState

VoiceState returns a Member's api.VoiceState for an api.Guild

func (*CacheImpl) VoiceStateCache added in v0.2.0

func (c *CacheImpl) VoiceStateCache(guildID api.Snowflake) map[api.Snowflake]*api.VoiceState

VoiceStateCache returns the api.VoiceState api.Cache of an api.Guild as a map

func (*CacheImpl) VoiceStates added in v0.2.0

func (c *CacheImpl) VoiceStates(guildID api.Snowflake) []*api.VoiceState

VoiceStates returns the member cache of a guild by snowflake

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) DisableCacheFlags added in v0.2.0

func (b *DisgoBuilderImpl) DisableCacheFlags(cacheFlags ...api.CacheFlags) api.DisgoBuilder

DisableCacheFlags lets you disable certain api.CacheFlags

func (*DisgoBuilderImpl) EnableCacheFlags added in v0.2.0

func (b *DisgoBuilderImpl) EnableCacheFlags(cacheFlags ...api.CacheFlags) api.DisgoBuilder

EnableCacheFlags lets you enable certain api.CacheFlags

func (*DisgoBuilderImpl) SetAudioController added in v0.2.0

func (b *DisgoBuilderImpl) SetAudioController(audioController api.AudioController) api.DisgoBuilder

SetAudioController lets you inject your own api.AudioController

func (*DisgoBuilderImpl) SetCache

func (b *DisgoBuilderImpl) SetCache(cache api.Cache) api.DisgoBuilder

SetCache lets you inject your own api.Cache

func (*DisgoBuilderImpl) SetCacheFlags added in v0.2.0

func (b *DisgoBuilderImpl) SetCacheFlags(cacheFlags ...api.CacheFlags) api.DisgoBuilder

SetCacheFlags lets you set the api.CacheFlags

func (*DisgoBuilderImpl) SetEntityBuilder added in v0.2.0

func (b *DisgoBuilderImpl) SetEntityBuilder(entityBuilder api.EntityBuilder) api.DisgoBuilder

SetEntityBuilder lets you inject your own api.EntityBuilder

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) SetGatewayIntents added in v0.3.3

func (b *DisgoBuilderImpl) SetGatewayIntents(gatewayIntents ...api.GatewayIntents) api.DisgoBuilder

SetGatewayIntents sets the api.GatewayIntents to connect to discord

func (*DisgoBuilderImpl) SetHTTPClient added in v0.3.0

func (b *DisgoBuilderImpl) SetHTTPClient(httpClient *http.Client) api.DisgoBuilder

SetHTTPClient sets the http.Client the api.RestClient uses

func (*DisgoBuilderImpl) SetLogger added in v0.2.0

func (b *DisgoBuilderImpl) SetLogger(logger log.Logger) api.DisgoBuilder

SetLogger sets logger implementation disgo should use as an example logrus

func (*DisgoBuilderImpl) SetMemberCachePolicy

func (b *DisgoBuilderImpl) SetMemberCachePolicy(memberCachePolicy api.MemberCachePolicy) api.DisgoBuilder

SetMemberCachePolicy lets you set your own api.MemberCachePolicy

func (*DisgoBuilderImpl) SetMessageCachePolicy added in v0.2.0

func (b *DisgoBuilderImpl) SetMessageCachePolicy(messageCachePolicy api.MessageCachePolicy) api.DisgoBuilder

SetMessageCachePolicy lets you set your own api.MessageCachePolicy

func (*DisgoBuilderImpl) SetRawGatewayEventsEnabled added in v0.2.0

func (b *DisgoBuilderImpl) SetRawGatewayEventsEnabled(enabled bool) api.DisgoBuilder

SetRawGatewayEventsEnabled enables/disables the events.RawGatewayEvent

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 BotToken to connect to discord

func (*DisgoBuilderImpl) SetVoiceDispatchInterceptor added in v0.2.0

func (b *DisgoBuilderImpl) SetVoiceDispatchInterceptor(voiceDispatchInterceptor api.VoiceDispatchInterceptor) api.DisgoBuilder

SetVoiceDispatchInterceptor sets the api.VoiceDispatchInterceptor

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

func (d *DisgoImpl) ApplicationID() api.Snowflake

ApplicationID returns the current application id

func (*DisgoImpl) AudioController added in v0.2.0

func (d *DisgoImpl) AudioController() api.AudioController

AudioController returns the api.AudioController which can be used to connect/reconnect/disconnect to/fom an api.VoiceChannel

func (*DisgoImpl) Cache

func (d *DisgoImpl) Cache() api.Cache

Cache returns the entity api.Cache used by disgo

func (*DisgoImpl) ClientID added in v0.4.5

func (d *DisgoImpl) ClientID() api.Snowflake

ClientID returns the current user id

func (*DisgoImpl) Close

func (d *DisgoImpl) Close()

Close will cleanup all disgo internals and close the discord connection safely

func (*DisgoImpl) Connect

func (d *DisgoImpl) Connect() error

Connect opens the gateway connection to discord

func (*DisgoImpl) CreateCommand

func (d *DisgoImpl) CreateCommand(command api.CommandCreate) (*api.Command, restclient.RestError)

CreateCommand creates a new global api.Command

func (*DisgoImpl) CreateGuildCommand added in v0.4.2

func (d *DisgoImpl) CreateGuildCommand(guildID api.Snowflake, command api.CommandCreate) (*api.Command, restclient.RestError)

CreateGuildCommand creates a new api.Command for this api.Guild

func (*DisgoImpl) CreateGuildFromTemplate added in v0.5.2

func (d *DisgoImpl) CreateGuildFromTemplate(templateCode string, createGuildFromTemplate api.CreateGuildFromTemplate) (*api.Guild, restclient.RestError)

CreateGuildFromTemplate creates an api.Guild using an api.Template code

func (*DisgoImpl) DeleteCommand

func (d *DisgoImpl) DeleteCommand(commandID api.Snowflake) restclient.RestError

DeleteCommand creates a new global api.Command

func (*DisgoImpl) DeleteGuildCommand added in v0.4.2

func (d *DisgoImpl) DeleteGuildCommand(guildID api.Snowflake, commandID api.Snowflake) restclient.RestError

DeleteGuildCommand creates a new api.Command for this api.Guild

func (*DisgoImpl) EditCommand

func (d *DisgoImpl) EditCommand(commandID api.Snowflake, command api.CommandUpdate) (*api.Command, restclient.RestError)

EditCommand edits a specific global api.Command

func (*DisgoImpl) EditGuildCommand added in v0.4.2

func (d *DisgoImpl) EditGuildCommand(guildID api.Snowflake, commandID api.Snowflake, command api.CommandUpdate) (*api.Command, restclient.RestError)

EditGuildCommand edits a specific api.Guild api.Command

func (*DisgoImpl) EntityBuilder added in v0.2.0

func (d *DisgoImpl) EntityBuilder() api.EntityBuilder

EntityBuilder returns the api.EntityBuilder

func (*DisgoImpl) EventManager

func (d *DisgoImpl) EventManager() api.EventManager

EventManager returns the api.EventManager

func (*DisgoImpl) Gateway

func (d *DisgoImpl) Gateway() api.Gateway

Gateway returns the websocket information

func (*DisgoImpl) GatewayIntents added in v0.3.3

func (d *DisgoImpl) GatewayIntents() api.GatewayIntents

GatewayIntents returns the GatewayIntents originally specified when creating the client

func (*DisgoImpl) GetCommand

func (d *DisgoImpl) GetCommand(commandID api.Snowflake) (*api.Command, restclient.RestError)

GetCommand fetches a specific global api.Command

func (*DisgoImpl) GetCommands

func (d *DisgoImpl) GetCommands() ([]*api.Command, restclient.RestError)

GetCommands fetches all global api.Command(s)

func (*DisgoImpl) GetGuildCommand added in v0.4.2

func (d *DisgoImpl) GetGuildCommand(guildID api.Snowflake, commandID api.Snowflake) (*api.Command, restclient.RestError)

GetGuildCommand fetches a specific api.Guild api.Command

func (*DisgoImpl) GetGuildCommandPermissions added in v0.4.2

func (d *DisgoImpl) GetGuildCommandPermissions(guildID api.Snowflake, commandID api.Snowflake) (*api.GuildCommandPermissions, restclient.RestError)

GetGuildCommandPermissions returns the api.GuildCommandPermissions for a specific api.Command in an api.Guild

func (*DisgoImpl) GetGuildCommands added in v0.4.2

func (d *DisgoImpl) GetGuildCommands(guildID api.Snowflake) ([]*api.Command, restclient.RestError)

GetGuildCommands fetches all api.Guild api.Command(s)

func (*DisgoImpl) GetGuildCommandsPermissions added in v0.4.2

func (d *DisgoImpl) GetGuildCommandsPermissions(guildID api.Snowflake) ([]*api.GuildCommandPermissions, restclient.RestError)

GetGuildCommandsPermissions returns the api.GuildCommandPermissions for a all api.Command(s) in an api.Guild

func (*DisgoImpl) GetTemplate added in v0.5.2

func (d *DisgoImpl) GetTemplate(code string) (*api.GuildTemplate, restclient.RestError)

GetTemplate gets an api.GuildTemplate by it's code

func (*DisgoImpl) HasGateway added in v0.2.0

func (d *DisgoImpl) HasGateway() bool

HasGateway returns whether api.Disgo has an active api.Gateway connection or not

func (*DisgoImpl) HeartbeatLatency

func (d *DisgoImpl) HeartbeatLatency() time.Duration

HeartbeatLatency returns the heartbeat latency

func (*DisgoImpl) LargeThreshold added in v0.2.0

func (d *DisgoImpl) LargeThreshold() int

LargeThreshold returns the large threshold set

func (*DisgoImpl) Logger added in v0.2.0

func (d *DisgoImpl) Logger() log.Logger

Logger returns the logger instance disgo uses

func (*DisgoImpl) RawGatewayEventsEnabled added in v0.2.0

func (d *DisgoImpl) RawGatewayEventsEnabled() bool

RawGatewayEventsEnabled returns if the events.RawGatewayEvent is enabled/disabled

func (*DisgoImpl) RestClient

func (d *DisgoImpl) RestClient() api.RestClient

RestClient returns the HTTP client used by disgo

func (*DisgoImpl) SelfUser

func (d *DisgoImpl) SelfUser() *api.SelfUser

SelfUser returns an api.SelfUser for the client, if available

func (*DisgoImpl) SetCommands

func (d *DisgoImpl) SetCommands(commands ...api.CommandCreate) ([]*api.Command, restclient.RestError)

SetCommands overrides all global api.Command(s)

func (*DisgoImpl) SetGuildCommandPermissions added in v0.4.2

func (d *DisgoImpl) SetGuildCommandPermissions(guildID api.Snowflake, commandID api.Snowflake, permissions api.SetGuildCommandPermissions) (*api.GuildCommandPermissions, restclient.RestError)

SetGuildCommandPermissions sets the api.GuildCommandPermissions for a specific api.Command

func (*DisgoImpl) SetGuildCommands added in v0.4.2

func (d *DisgoImpl) SetGuildCommands(guildID api.Snowflake, commands ...api.CommandCreate) ([]*api.Command, restclient.RestError)

SetGuildCommands overrides all api.Command(s) for this api.Guild

func (*DisgoImpl) SetGuildCommandsPermissions added in v0.4.2

func (d *DisgoImpl) SetGuildCommandsPermissions(guildID api.Snowflake, commandPermissions ...api.SetGuildCommandPermissions) ([]*api.GuildCommandPermissions, restclient.RestError)

SetGuildCommandsPermissions sets the api.GuildCommandPermissions for a all api.Command(s)

func (*DisgoImpl) SetVoiceDispatchInterceptor added in v0.2.0

func (d *DisgoImpl) SetVoiceDispatchInterceptor(voiceDispatchInterceptor api.VoiceDispatchInterceptor)

SetVoiceDispatchInterceptor sets the api.VoiceDispatchInterceptor

func (*DisgoImpl) Start

func (d *DisgoImpl) Start()

Start starts the interaction webhook server

func (*DisgoImpl) Token

func (d *DisgoImpl) Token() string

Token returns the BotToken of the client

func (*DisgoImpl) VoiceDispatchInterceptor added in v0.2.0

func (d *DisgoImpl) VoiceDispatchInterceptor() api.VoiceDispatchInterceptor

VoiceDispatchInterceptor returns the api.VoiceDispatchInterceptor

func (*DisgoImpl) WebhookServer

func (d *DisgoImpl) WebhookServer() api.WebhookServer

WebhookServer returns the api.EventManager

type EntityBuilderImpl added in v0.2.0

type EntityBuilderImpl struct {
	// contains filtered or unexported fields
}

EntityBuilderImpl is used for creating structs used by Disgo

func (*EntityBuilderImpl) CreateAuditLog added in v0.5.6

func (b *EntityBuilderImpl) CreateAuditLog(guildID api.Snowflake, auditLogFilterOptions api.AuditLogFilterOptions, auditLog *api.AuditLog, updateCache api.CacheStrategy) *api.AuditLog

CreateAuditLog returns a new api.AuditLog entity

func (*EntityBuilderImpl) CreateButtonInteraction added in v0.4.0

func (b *EntityBuilderImpl) CreateButtonInteraction(fullInteraction *api.FullInteraction, componentInteraction *api.ComponentInteraction) *api.ButtonInteraction

CreateButtonInteraction creates an api.ButtonInteraction from the api.FullInteraction response

func (*EntityBuilderImpl) CreateCategory added in v0.2.0

func (b *EntityBuilderImpl) CreateCategory(channel *api.Channel, updateCache api.CacheStrategy) *api.Category

CreateCategory returns a new api.Category entity

func (*EntityBuilderImpl) CreateCommandInteraction added in v0.4.0

func (b *EntityBuilderImpl) CreateCommandInteraction(fullInteraction *api.FullInteraction, interaction *api.Interaction, updateCache api.CacheStrategy) *api.CommandInteraction

CreateCommandInteraction creates an api.CommandInteraction from the api.FullInteraction response

func (*EntityBuilderImpl) CreateComponentInteraction added in v0.4.5

func (b *EntityBuilderImpl) CreateComponentInteraction(fullInteraction *api.FullInteraction, interaction *api.Interaction, updateCache api.CacheStrategy) *api.ComponentInteraction

CreateComponentInteraction creates an api.ComponentInteraction from the api.FullInteraction response

func (*EntityBuilderImpl) CreateDMChannel added in v0.2.0

func (b *EntityBuilderImpl) CreateDMChannel(channel *api.Channel, updateCache api.CacheStrategy) *api.DMChannel

CreateDMChannel returns a new api.DMChannel entity

func (*EntityBuilderImpl) CreateEmoji added in v0.4.3

func (b *EntityBuilderImpl) CreateEmoji(guildID api.Snowflake, emoji *api.Emoji, updateCache api.CacheStrategy) *api.Emoji

CreateEmoji returns a new api.Emoji entity

func (*EntityBuilderImpl) CreateGlobalCommand added in v0.2.0

func (b *EntityBuilderImpl) CreateGlobalCommand(command *api.Command, updateCache api.CacheStrategy) *api.Command

CreateGlobalCommand returns a new api.Command entity

func (*EntityBuilderImpl) CreateGuild added in v0.2.0

func (b *EntityBuilderImpl) CreateGuild(fullGuild *api.FullGuild, updateCache api.CacheStrategy) *api.Guild

CreateGuild returns a new api.Guild entity

func (*EntityBuilderImpl) CreateGuildCommand added in v0.2.0

func (b *EntityBuilderImpl) CreateGuildCommand(guildID api.Snowflake, command *api.Command, updateCache api.CacheStrategy) *api.Command

CreateGuildCommand returns a new api.Command entity

func (*EntityBuilderImpl) CreateGuildCommandPermissions added in v0.2.0

func (b *EntityBuilderImpl) CreateGuildCommandPermissions(guildCommandPermissions *api.GuildCommandPermissions, updateCache api.CacheStrategy) *api.GuildCommandPermissions

CreateGuildCommandPermissions returns a new api.GuildCommandPermissions entity

func (*EntityBuilderImpl) CreateGuildTemplate added in v0.5.2

func (b *EntityBuilderImpl) CreateGuildTemplate(guildTemplate *api.GuildTemplate, updateCache api.CacheStrategy) *api.GuildTemplate

CreateGuildTemplate returns a new api.GuildTemplate entity

func (*EntityBuilderImpl) CreateIntegration added in v0.5.6

func (b *EntityBuilderImpl) CreateIntegration(guildID api.Snowflake, integration *api.Integration, updateCache api.CacheStrategy) *api.Integration

CreateIntegration returns a new api.Integration entity

func (EntityBuilderImpl) CreateInteraction added in v0.3.0

func (b EntityBuilderImpl) CreateInteraction(fullInteraction *api.FullInteraction, c chan api.InteractionResponse, updateCache api.CacheStrategy) *api.Interaction

CreateInteraction creates an api.Interaction from the api.FullInteraction response

func (*EntityBuilderImpl) CreateMember added in v0.2.0

func (b *EntityBuilderImpl) CreateMember(guildID api.Snowflake, member *api.Member, updateCache api.CacheStrategy) *api.Member

CreateMember returns a new api.Member entity

func (*EntityBuilderImpl) CreateMessage added in v0.2.0

func (b *EntityBuilderImpl) CreateMessage(message *api.Message, updateCache api.CacheStrategy) *api.Message

CreateMessage returns a new api.Message entity

func (*EntityBuilderImpl) CreateRole added in v0.2.0

func (b *EntityBuilderImpl) CreateRole(guildID api.Snowflake, role *api.Role, updateCache api.CacheStrategy) *api.Role

CreateRole returns a new api.Role entity

func (*EntityBuilderImpl) CreateSelectMenuInteraction added in v0.4.5

func (b *EntityBuilderImpl) CreateSelectMenuInteraction(fullInteraction *api.FullInteraction, componentInteraction *api.ComponentInteraction) *api.SelectMenuInteraction

CreateSelectMenuInteraction creates an api.SelectMenuInteraction from the api.FullInteraction response

func (*EntityBuilderImpl) CreateStoreChannel added in v0.2.0

func (b *EntityBuilderImpl) CreateStoreChannel(channel *api.Channel, updateCache api.CacheStrategy) *api.StoreChannel

CreateStoreChannel returns a new api.StoreChannel entity

func (*EntityBuilderImpl) CreateTextChannel added in v0.2.0

func (b *EntityBuilderImpl) CreateTextChannel(channel *api.Channel, updateCache api.CacheStrategy) *api.TextChannel

CreateTextChannel returns a new api.TextChannel entity

func (*EntityBuilderImpl) CreateUser added in v0.2.0

func (b *EntityBuilderImpl) CreateUser(user *api.User, updateCache api.CacheStrategy) *api.User

CreateUser returns a new api.User entity

func (*EntityBuilderImpl) CreateVoiceChannel added in v0.2.0

func (b *EntityBuilderImpl) CreateVoiceChannel(channel *api.Channel, updateCache api.CacheStrategy) *api.VoiceChannel

CreateVoiceChannel returns a new api.VoiceChannel entity

func (*EntityBuilderImpl) CreateVoiceState added in v0.2.0

func (b *EntityBuilderImpl) CreateVoiceState(guildID api.Snowflake, voiceState *api.VoiceState, updateCache api.CacheStrategy) *api.VoiceState

CreateVoiceState returns a new api.VoiceState entity

func (*EntityBuilderImpl) Disgo added in v0.2.0

func (b *EntityBuilderImpl) Disgo() api.Disgo

Disgo returns the api.Disgo client

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) Close added in v0.2.0

func (e *EventManagerImpl) Close()

Close closes all goroutines created by the api.EventManager

func (*EventManagerImpl) Disgo added in v0.2.0

func (e *EventManagerImpl) Disgo() api.Disgo

Disgo returns the api.Disgo instance used by the api.EventManager

func (*EventManagerImpl) Dispatch

func (e *EventManagerImpl) Dispatch(event api.Event)

Dispatch dispatches a new event to the client

func (*EventManagerImpl) Handle

func (e *EventManagerImpl) Handle(name api.GatewayEventType, c chan api.InteractionResponse, sequenceNumber int, payload json.RawMessage)

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) Close

func (g *GatewayImpl) Close()

Close cleans up the gateway internals

func (*GatewayImpl) Conn added in v0.2.0

func (g *GatewayImpl) Conn() *websocket.Conn

Conn returns the underlying websocket.Conn of this api.Gateway

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) Send added in v0.4.5

func (g *GatewayImpl) Send(command api.GatewayCommand) error

Send sends a payload to the Gateway

func (*GatewayImpl) Status

func (g *GatewayImpl) Status() api.GatewayStatus

Status returns the gateway connection status

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()

Start makes the WebhookServerImpl listen on the specified port and handle requests

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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