command

package
v0.0.0-...-aa48d00 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Overview

Package command contains all the commands

Index

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

func Status

func Status(bot *tgbotapi.BotAPI, u tgbotapi.Update)

Status prints the internat status of the bot

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

Jump to

Keyboard shortcuts

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