Archived
1

Three special chats in config

This commit is contained in:
2017-11-26 16:54:06 +04:00
parent a0bfc6b32f
commit ca147a99a3
5 changed files with 22 additions and 14 deletions

View File

@@ -6,6 +6,7 @@ package welcomer
import (
"github.com/go-telegram-bot-api/telegram-bot-api"
"lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping"
"strconv"
)
// PrivateWelcomeMessageUnauthorized tell new user what to do.
@@ -51,7 +52,10 @@ func (w *Welcomer) GroupWelcomeMessage(update *tgbotapi.Update) string {
if (newUser.UserName == "i2_bot") || (newUser.UserName == "i2_dev_bot") {
w.groupStartMessage(update)
} else {
w.groupWelcomeUser(update, &newUser)
defaultGroupID, _ := strconv.ParseInt(c.Cfg.SpecialChats.HeadquartersID, 10, 64)
if update.Message.Chat.ID == defaultGroupID {
w.groupWelcomeUser(update, &newUser)
}
}
}