29 lines
690 B
Go
29 lines
690 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.nefrace.ru/nefrace/nechotron"
|
|
)
|
|
|
|
var commandMe = nechotron.NewCommand("me", false)
|
|
|
|
func handleMe(u *nechotron.UpdateCommand) error {
|
|
_, err := u.AnswerMarkdown(fmt.Sprintf("_*%s* %s_", nechotron.EscapeMd2(u.From().FirstName), nechotron.EscapeMd2(u.Param)))
|
|
return err
|
|
}
|
|
|
|
var commandHelp = nechotron.NewCommand("help", false)
|
|
|
|
func handleHelp(u *nechotron.UpdateCommand) error {
|
|
_, err := u.AnswerPlain("Тут текст помощи")
|
|
return err
|
|
}
|
|
|
|
var commandSay = nechotron.NewCommand("say", true)
|
|
|
|
func handleSay(u *nechotron.UpdateCommand) error {
|
|
_, err := u.AnswerMarkdown(fmt.Sprintf("*_%s_*", nechotron.EscapeMd2(u.Param)))
|
|
return err
|
|
}
|