mtn_go_discord_framework

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func CheckForRoles(s *discordgo.Session, i *discordgo.InteractionCreate, roles ...string) bool

checkForRoles checks if a member has one of the provided roles

func InitFramework

func InitFramework(debugMode bool, testingGuildId string, botToken string) *discordgo.Session

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 ButtonHandler struct {
	CustomID string
	Handler  func(s *discordgo.Session, i *discordgo.InteractionCreate, args ...string)
}

type Command

type Command struct {
	discordgo.ApplicationCommand
	Handler func(s *discordgo.Session, i *discordgo.InteractionCreate, args ...string)
}

Jump to

Keyboard shortcuts

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