new gaypoints feature
This commit is contained in:
parent
69e93622b3
commit
6115e09602
10 changed files with 310 additions and 14 deletions
|
@ -7,16 +7,34 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
"watn3y/bloaterbotv3/botIO"
|
||||
"watn3y/bloaterbotv3/commands/gaypoints"
|
||||
"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")
|
||||
|
||||
log.Println("Shutting up for Chat: " + strconv.FormatInt(update.Message.Chat.ID, 10))
|
||||
cmd := strings.ToLower(update.Message.Command())
|
||||
|
||||
botIO.SendMessage(msg, bot)
|
||||
switch cmd {
|
||||
case "shutup":
|
||||
shutup(update, bot)
|
||||
case "shut":
|
||||
shutup(update, bot)
|
||||
case "gp":
|
||||
gaypoints.GetGP(update, bot)
|
||||
case "addgp":
|
||||
gaypoints.SetGP(update, bot)
|
||||
case "subtracktgp":
|
||||
gaypoints.SetGP(update, bot)
|
||||
}
|
||||
}
|
||||
|
||||
func shutup(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
|
||||
config.BotConfig.Shutup[update.Message.Chat.ID] = time.Now().UTC()
|
||||
msg := tgbotapi.NewMessage(update.Message.Chat.ID, "Shutting up")
|
||||
|
||||
log.Println("Shutting up for Chat: " + strconv.FormatInt(update.Message.Chat.ID, 10))
|
||||
|
||||
botIO.SendMessage(msg, bot)
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue