Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateOAuthURL(id string) string
- func ParseToken(t string) (string, error)
- func RegisterCommands(p RegisterCommandsParams) error
- type ApplicationCommandWithHandler
- type BotConfig
- type Channel
- type Guild
- type HandlerFunc
- type InteractionHelper
- type NewSessionParams
- type NewSessionResult
- type RegisterCommandsParams
Constants ¶
View Source
const ConfigurationKey = "discord"
Variables ¶
View Source
var Module = fx.Options(fx.Provide(NewDiscordSession), fx.Invoke(RegisterCommands))
Functions ¶
func GenerateOAuthURL ¶
func ParseToken ¶
ParseToken parses the oauth id out of the bot token
func RegisterCommands ¶
func RegisterCommands(p RegisterCommandsParams) error
Types ¶
type ApplicationCommandWithHandler ¶
type ApplicationCommandWithHandler struct { Command discordgo.ApplicationCommand Handler HandlerFunc GuildID string }
ApplicationCommandWithHandler is a top level Command with a Handler function. Subcommands are TODO todo: define our own handler func? want to use channels to post back messages.
type Channel ¶
type Channel string
Channel represents a Channel ID or Channel URL in the config.
func (*Channel) UnmarshalYAML ¶
type Guild ¶
type Guild string
Guild represents a Guild ID or Guild URL in the config. TODO Make this work properly. Currently requires the user to truncate the channel if they want URL notation.
func (*Guild) UnmarshalYAML ¶
type HandlerFunc ¶
type InteractionHelper ¶
type InteractionHelper interface { GetInteraction() *discordgo.InteractionCreate Respond() (<-chan *discordgo.WebhookEdit, error) RespondWebhook() (<-chan *discordgo.WebhookEdit, error) }
func NewInteractionHelper ¶
func NewInteractionHelper(i *discordgo.InteractionCreate) InteractionHelper
type NewSessionParams ¶
type NewSessionResult ¶
func NewDiscordSession ¶
func NewDiscordSession(p NewSessionParams) (NewSessionResult, error)
Click to show internal directories.
Click to hide internal directories.