internal

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 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 token

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 CacheImpl

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

CacheImpl is used for Disgo's 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) 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) 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)

CacheCategory adds a category to the cache

func (*CacheImpl) CacheDMChannel

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

CacheDMChannel adds a DM channel to the cache

func (*CacheImpl) CacheGuild

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

CacheGuild adds a guild to the cache

func (*CacheImpl) CacheMember

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

CacheMember adds a member to the cache

func (*CacheImpl) CacheRole

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

CacheRole adds a role 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) CacheUser

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

CacheUser adds a user to the cache

func (*CacheImpl) CacheVoiceChannel

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

CacheVoiceChannel adds a voice channel to 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) 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) 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

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

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

MessageChannel returns a channel from dm or text channel cache by ID

func (*CacheImpl) Role

func (c *CacheImpl) Role(guildID api.Snowflake, 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) UncacheDMChannel

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

UncacheDMChannel removes a DM channel from 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) 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) 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

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

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

ApplicationID returns the current application id

func (*DisgoImpl) Cache

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

Cache returns the entity api.Cache used by disgo

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.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) Gateway

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

Gateway returns the websocket information

func (DisgoImpl) GetCommand

func (d DisgoImpl) GetCommand(commandID api.Snowflake) (*api.SlashCommand, error)

GetCommand fetches a specific guild command

func (DisgoImpl) GetCommands

func (d DisgoImpl) GetCommands() ([]*api.SlashCommand, error)

GetCommands fetches all guild commands

func (*DisgoImpl) HeartbeatLatency

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

HeartbeatLatency returns the heartbeat latency

func (*DisgoImpl) Intents

func (d *DisgoImpl) Intents() api.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) SelfUser

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

SelfUser returns a user object for the client, if available

func (DisgoImpl) SetCommands

func (d DisgoImpl) SetCommands(commands ...api.SlashCommand) ([]*api.SlashCommand, error)

SetCommands overrides all commands for this guild

func (*DisgoImpl) SetSelfUser

func (d *DisgoImpl) SetSelfUser(user *api.User)

SetSelfUser sets the self user

func (*DisgoImpl) Start

func (d *DisgoImpl) Start() error

Start starts the interaction webhook server

func (*DisgoImpl) Token

func (d *DisgoImpl) Token() string

Token returns the token of the client

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

func (g *GatewayImpl) Close()

Close cleans up the gateway internals

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

type RestClientImpl struct {
	Client *http.Client
	// contains filtered or unexported fields
}

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

func (r RestClientImpl) DeleteRole(guildID api.Snowflake, roleID api.Snowflake) (err error)

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

func (r RestClientImpl) GetMembers(guildID api.Snowflake) (members []*api.Member, err error)

GetMembers fetches all members for a guild

func (RestClientImpl) GetRoles

func (r RestClientImpl) GetRoles(guildID api.Snowflake) (roles []*api.Role, err error)

GetRoles fetches all roles from a guild

func (RestClientImpl) GetUser

func (r RestClientImpl) GetUser(userID api.Snowflake) (user *api.User, err error)

GetUser fetches the specific user

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

func (r RestClientImpl) OpenDMChannel(userID api.Snowflake) (channel *api.DMChannel, err error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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