Documentation ¶
Overview ¶
Package command contains all the commands
Index ¶
- Constants
- Variables
- func AnalyzeCommand(bot *tgbotapi.BotAPI, u tgbotapi.Update) (executed bool)
- func AnswerFreq(bot *tgbotapi.BotAPI, u tgbotapi.Update)
- func EnabledCommand(bot *tgbotapi.BotAPI, u tgbotapi.Update)
- func HelpCommand(bot *tgbotapi.BotAPI, u tgbotapi.Update)
- func PoleCommand(bot *tgbotapi.BotAPI, u tgbotapi.Update)
- func Status(bot *tgbotapi.BotAPI, u tgbotapi.Update)
- type CommandFilter
Constants ¶
View Source
const HackingAttempt string = "acabas de disipar todas mis dudas, definitivamente eres tonto"
View Source
const InternalError string = "Uy, algún sugusiano me ha programado mal y acabo de dar un pete interno.\n" +
"Activando protocolo dedo oreja"
View Source
const NoCommand string = "hola como uso un comando? unsaludogracias 😂"
View Source
const OnlyAdmin string = "acaso eres admin? Que *P* y que *S*" // Need ParseMode Markdown
Variables ¶
View Source
var CommandsFilter map[string]CommandFilter
Functions ¶
func AnalyzeCommand ¶
func AnalyzeCommand(bot *tgbotapi.BotAPI, u tgbotapi.Update) (executed bool)
Analize the command and execute the corresponding function
func AnswerFreq ¶
func AnswerFreq(bot *tgbotapi.BotAPI, u tgbotapi.Update)
AnswerFreq handles the asignation of a new frequence in the answers
func EnabledCommand ¶
func EnabledCommand(bot *tgbotapi.BotAPI, u tgbotapi.Update)
EnabledCommand handles the enabled or disabled status
func HelpCommand ¶
func HelpCommand(bot *tgbotapi.BotAPI, u tgbotapi.Update)
HelpCommand prints the main information
func PoleCommand ¶
func PoleCommand(bot *tgbotapi.BotAPI, u tgbotapi.Update)
PoleCommand handles the enabled or disabled pole
Types ¶
type CommandFilter ¶
type CommandFilter struct { // Text with which must start the message Command string // Define is can only be execute by admins OnlyAdmin bool // Function to execute in positive case Func func(bot *tgbotapi.BotAPI, u tgbotapi.Update) }
ChatConfig contains the base configuration for a single user
Click to show internal directories.
Click to hide internal directories.