From d8bb106df66a29859dbd6995aef7d52cd9a89ae0 Mon Sep 17 00:00:00 2001 From: Watn3y Date: Sun, 19 Mar 2023 14:20:21 +0100 Subject: [PATCH] gaypoints disallowed user message --- commands/gaypoints/gaypoints.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/commands/gaypoints/gaypoints.go b/commands/gaypoints/gaypoints.go index 4f5dd30..42243ae 100644 --- a/commands/gaypoints/gaypoints.go +++ b/commands/gaypoints/gaypoints.go @@ -65,10 +65,23 @@ func GetGP(update tgbotapi.Update, bot *tgbotapi.BotAPI) { } func SetGP(update tgbotapi.Update, bot *tgbotapi.BotAPI) { - if !commonlogic.ContainsInt64(config.BotConfig.GayPoints.EnabledChats, update.Message.Chat.ID) || !commonlogic.ContainsInt64(config.BotConfig.GayPoints.ModifyUsers, update.Message.From.ID) { + if !commonlogic.ContainsInt64(config.BotConfig.GayPoints.EnabledChats, update.Message.Chat.ID) { return } + if !commonlogic.ContainsInt64(config.BotConfig.GayPoints.ModifyUsers, update.Message.From.ID) { + if update.Message.ReplyToMessage == nil { + message := tgbotapi.MessageConfig{ + BaseChat: tgbotapi.BaseChat{ChatID: update.Message.Chat.ID, ReplyToMessageID: update.Message.MessageID}, + ParseMode: "html", + DisableWebPagePreview: false, + Text: "Who the fuck do you think you are telling me what to do?", + } + botIO.SendMessage(message, bot) + return + } + } + cmd := strings.ToLower(update.Message.Command()) commandArgs := strings.Fields(update.Message.CommandArguments())