refine shutup feature
This commit is contained in:
parent
ed2d94f810
commit
e0f0f2d282
7 changed files with 70 additions and 48 deletions
17
commands/commands.go
Normal file
17
commands/commands.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package commands
|
||||
|
||||
import (
|
||||
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
||||
"strings"
|
||||
"time"
|
||||
"watn3y/bloaterbotv3/botIO"
|
||||
"watn3y/bloaterbotv3/config"
|
||||
)
|
||||
|
||||
func Commands(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
|
||||
if strings.ToLower(update.Message.Command()) == "shutup" || strings.ToLower(update.Message.Command()) == "shut" {
|
||||
config.BotConfig.Shutup[update.Message.Chat.ID] = time.Now().UTC()
|
||||
msg := tgbotapi.NewMessage(update.Message.Chat.ID, "Shutting up")
|
||||
botIO.SendMessage(msg, bot)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue