handlers

package
v0.0.0-...-0d9fe52 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AvailableCommands = []commandtypes.AcceptedCommands{
	{
		Command:     "join",
		Description: "Join the virtual queue for the photobooth.",
		Handler:     JoinCommand,
	},
	{
		Command:     "leave",
		Description: "Leave the virtual queue for the photobooth.",
		Handler:     LeaveCommand,
	},
	{
		Command:     "seequeue",
		Description: "(admins only - check this): see the contents of the queue now.",
		Handler:     SeeQueueCommand,
	},
	{
		Command:     "ping",
		Description: "(admins only - check this): send a reminder to the first person in queue.",
		Handler:     PingCommand,
	},
	{
		Command:     "kick",
		Description: "(admins only - check this): remove the person at some set position",
		Handler:     KickCommand,
	},
	{
		Command:     "howlong",
		Description: "Returns the expected time to wait in the queue",
		Handler:     HowLongCommand,
	},
	{
		Command:     "help",
		Description: "Explains the main functionalities of the bot.",
		Handler:     HelpCommand,
	},
	{
		Command:     "start",
		Description: "Explains the main functionalities of the bot.",
		Handler:     HelpCommand,
	},
}

Command and description is hard-coded within the HelpFunction for circular dependencies. You will need to update the help function accordingly if you want to change this definition. If this becomes too troublesome, consider using the reflect package to store the handler function names under a string first before using reflect.ValueOf().Call()

Functions

func HelpCommand

func HelpCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)

func HowLongCommand

func HowLongCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)

To update: should be variable based on whether you have joined the queue.

func InvalidCommand

func InvalidCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)

func JoinCommand

func JoinCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)

func KickCommand

func KickCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)

func LeaveCommand

func LeaveCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)

func NonCommandHandler

func NonCommandHandler(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)

func NonTextHandler

func NonTextHandler(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)

func PingCommand

func PingCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)

Indirectly called handlers

func SeeQueueCommand

func SeeQueueCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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