Documentation
¶
Index ¶
- func BusySleep()
- func CheckForRoles(s *discordgo.Session, i *discordgo.InteractionCreate, roles ...string) bool
- func InitFramework(debugMode bool, testingGuildId string, botToken string) *discordgo.Session
- func RegisterButtonHandlerWithFramework(handler ButtonHandler)
- func RegisterButtonHandlersWithFramework(handlers []ButtonHandler)
- func RegisterSlashCommandWithFramework(command Command)
- func RegisterSlashCommandsWithFramework(commands []Command)
- func ReleaseSystem()
- func SendDeferResponse(s *discordgo.Session, i *discordgo.InteractionCreate)
- func SendEphemeralResponse(s *discordgo.Session, i *discordgo.InteractionCreate, msg string)
- func ShutdownFramework()
- func StartFramework()
- func TryAcquireSystem() bool
- type ButtonHandler
- type Command
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BusySleep ¶
func BusySleep()
busySleep pauses execution for up to 10 seconds if the system is busy
func CheckForRoles ¶
checkForRoles checks if a member has one of the provided roles
func InitFramework ¶
Initializes the framework and returns a discord session, needed for the other functions
func RegisterButtonHandlerWithFramework ¶
func RegisterButtonHandlerWithFramework(handler ButtonHandler)
Registers a button handler with the framework
func RegisterButtonHandlersWithFramework ¶ added in v0.1.3
func RegisterButtonHandlersWithFramework(handlers []ButtonHandler)
Registers multiple button handlers with the framework
func RegisterSlashCommandWithFramework ¶
func RegisterSlashCommandWithFramework(command Command)
Registers a slash command with the framework
func RegisterSlashCommandsWithFramework ¶ added in v0.1.3
func RegisterSlashCommandsWithFramework(commands []Command)
Registers multiple slash commands with the framework
func ReleaseSystem ¶
func ReleaseSystem()
Set systemBusy to false. Should be deferred after a successful tryAcquireSystem.
func SendDeferResponse ¶
func SendDeferResponse(s *discordgo.Session, i *discordgo.InteractionCreate)
sendDeferResponse sends a deferred response to an interaction
func SendEphemeralResponse ¶
func SendEphemeralResponse(s *discordgo.Session, i *discordgo.InteractionCreate, msg string)
sendEphemeralResponse sends a response to an interaction that only the user can see
func ShutdownFramework ¶
func ShutdownFramework()
Shuts down the framework and closes the discord session
func StartFramework ¶
func StartFramework()
Launches the framework and registers all commands and handlers
func TryAcquireSystem ¶
func TryAcquireSystem() bool
Check if the system is busy. If not, set it to busy and return true. If it is busy, return false.
Types ¶
type ButtonHandler ¶
type Command ¶
type Command struct {
discordgo.ApplicationCommand
Handler func(s *discordgo.Session, i *discordgo.InteractionCreate, args ...string)
}