123456789101112131415161718192021 |
- package handler
- import (
- tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
- log "gogs.veloe.link/toomanysugar/GoEthemineTelegramBot/internal/logger"
- )
- func (ah ActionHandler) StopHandler(chatId int64, params []string) []tgbotapi.MessageConfig {
- if len(params) != 0 {
- return []tgbotapi.MessageConfig{tgbotapi.NewMessage(chatId, "usage: /stop")}
- }
- text, err := ah.dbconn.DeleteUser(chatId)
- if err != nil {
- log.LogError.Println(err)
- text = "Internal error, please contact bot developer"
- }
- return []tgbotapi.MessageConfig{
- tgbotapi.NewMessage(chatId, text)}
- }
|