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