Added "banned" status for players
This commit is contained in:
@@ -16,6 +16,10 @@ func (r *Router) RouteCallback(update *tgbotapi.Update) string {
|
||||
return "fail"
|
||||
}
|
||||
|
||||
if playerRaw.Status == "banned" {
|
||||
return c.Talkers.BanError(update)
|
||||
}
|
||||
|
||||
var enableAlarmCallback = regexp.MustCompile("enable_reminder_(\\d+)\\z")
|
||||
var disableAlarmCallback = regexp.MustCompile("disable_reminder_(\\d+)\\z")
|
||||
|
||||
|
@@ -19,7 +19,7 @@ func (r *Router) RouteInline(update *tgbotapi.Update) string {
|
||||
|
||||
results := make([]interface{}, 0)
|
||||
|
||||
if playerRaw.LeagueID != 1 {
|
||||
if (playerRaw.LeagueID != 1) || (playerRaw.Status == "banned") {
|
||||
article := tgbotapi.NewInlineQueryResultArticle("0", "Команда боту @PokememBroBot:", "👤Герой")
|
||||
article.Description = "👤Герой"
|
||||
|
||||
|
@@ -20,6 +20,10 @@ func (r *Router) routePrivateRequest(update *tgbotapi.Update, playerRaw *dbmappi
|
||||
var squadInfoMsg = regexp.MustCompile("/show_squad(\\d+)\\z")
|
||||
var orderSendMsg = regexp.MustCompile("/send_order(\\d+)\\z")
|
||||
|
||||
if playerRaw.Status == "banned" {
|
||||
return c.Talkers.BanError(update)
|
||||
}
|
||||
|
||||
if update.Message.ForwardFrom != nil {
|
||||
if update.Message.ForwardFrom.ID != 360402625 {
|
||||
c.Log.Info("Forward from another user or bot. Ignoring")
|
||||
|
Reference in New Issue
Block a user