go-dette/commands.go

31 lines
940 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package main
import (
"fmt"
neco "git.nefrace.ru/nefrace/nechotron"
)
var commandMe = neco.NewCommand("me", "Пишу ваш текст о вас в третьем лице", false)
func handleMe(u *neco.UpdateCommand) error {
_, err := u.AnswerMarkdown(fmt.Sprintf("_*%s* %s_", neco.EscapeMd2(u.From().FirstName), neco.EscapeMd2(u.Param)))
return err
}
var commandHelp = neco.NewCommand("help", "Показываю данный текст", false)
func handleHelp(u *neco.UpdateCommand) error {
_, err := u.AnswerPlain("Тут текст помощи")
return err
}
var commandSay = neco.NewCommand("say", "Пишу ваш текст от своего имени.", true)
func handleSay(u *neco.UpdateCommand) error {
_, err := u.AnswerMarkdown(fmt.Sprintf("*_%s_*", neco.EscapeMd2(u.Param)))
return err
}
var commandWarn = neco.NewCommand("warn", "Делаю предупреждение пользователю", true)