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 RegisterSlashCommandWithFramework(command 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 ¶
func RegisterButtonHandlerWithFramework ¶
func RegisterButtonHandlerWithFramework(handler ButtonHandler)
func RegisterSlashCommandWithFramework ¶
func RegisterSlashCommandWithFramework(command Command)
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()
func StartFramework ¶
func StartFramework()
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)
}