Documentation
¶
Index ¶
- Constants
- Variables
- func AddAdminCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func AddDummyCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func AdminHelpCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func CheckAdminListCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func GetBotAPIConnection() (*tgbotapi.BotAPI, error)
- func GreetFeedback(name string) string
- func HowLongCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func HowLongFeedback(queueLength int) string
- func InitializeBotAPIConnection() *tgbotapi.BotAPI
- func InvalidCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func JoinCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func KickCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func LeaveCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func NonCommandHandler(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func NonTextHandler(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func PingCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func RemoveAdminCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func RemoveFirstInQueueCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func SeeQueueCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func StartQueueCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func StopQueueCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
- func UserHelpCommand(userMessage tgbotapi.Update, bot *tgbotapi.BotAPI) (feedback string)
Constants ¶
const (
HelpFeepback string = `` /* 361-byte string literal not displayed */
)
handlers
Variables ¶
var AdminCommands = []types.AcceptedCommands{ { Command: "seequeue", Description: "see who is in the queue now.", Handler: SeeQueueCommand, }, { Command: "ping", Description: "send a reminder to the first person in queue.", Handler: PingCommand, }, { Command: "done", Description: "remove the first person from the queue once they have finished their photo-taking.", Handler: RemoveFirstInQueueCommand, }, { Command: "kick", Description: "remove the specified person from the queue.", Handler: KickCommand, }, { Command: "stopqueue", Description: "Stop admitting perople into the queue.", Handler: StopQueueCommand, }, { Command: "startqueue", Description: "Start admitting perople into the queue.", Handler: StartQueueCommand, }, { Command: "adminlist", Description: "see who has the ability to control the bot.", Handler: CheckAdminListCommand, }, { Command: "addadmin", Description: "allow another person to control the bot, e.g. /addadmin @abc", Handler: AddAdminCommand, }, { Command: "removeadmin", Description: "remove admin rights for some user, e.g. /removeadmin @abc", Handler: RemoveAdminCommand, }, { Command: "addDummy12345", Description: "FOR TESTING ONLY", Handler: AddDummyCommand, }, { Command: "help", Description: "Explains the main functionalities of the bot.", Handler: AdminHelpCommand, }, { Command: "start", Description: "Explains the main functionalities of the bot.", Handler: AdminHelpCommand, }, }
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()
var UserCommands = []types.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: "howlong", Description: "Returns the expected time to wait in the queue", Handler: HowLongCommand, }, { Command: "help", Description: "Explains the main functionalities of the bot.", Handler: UserHelpCommand, }, { Command: "start", Description: "Explains the main functionalities of the bot.", Handler: UserHelpCommand, }, }
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 AddAdminCommand ¶
func AddDummyCommand ¶
func AdminHelpCommand ¶
func CheckAdminListCommand ¶
func GetBotAPIConnection ¶
func GreetFeedback ¶
func HowLongCommand ¶
To update: should be variable based on whether you have joined the queue.
func HowLongFeedback ¶
func InitializeBotAPIConnection ¶
implicit .env arguments: BOT_TOKEN.
func InvalidCommand ¶
func JoinCommand ¶
func KickCommand ¶
func LeaveCommand ¶
func NonCommandHandler ¶
func NonTextHandler ¶
func PingCommand ¶
func RemoveAdminCommand ¶
func SeeQueueCommand ¶
func StartQueueCommand ¶
func StopQueueCommand ¶
Types ¶
This section is empty.