Always respond if the Chat is DM

This commit is contained in:
Watn3y 2023-03-05 06:06:53 +01:00
parent ce23ec62d6
commit 99243dba04

View file

@ -23,14 +23,14 @@ func Matcher(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
if err != nil {
log.Panicf("Failed to compile regex for nhentai", err)
}
if isNhentai && commonlogic.ContainsInt64(config.BotConfig.Nhentai.EnabledChats, update.Message.Chat.ID) {
if isNhentai && (commonlogic.ContainsInt64(config.BotConfig.Nhentai.EnabledChats, update.Message.Chat.ID) || update.Message.From.ID == update.Message.Chat.ID) {
go nhentai.Nhentai(nhentaiRegex, update, bot)
}
//balonlyl
var isBalonlyl bool = false
for _, word := range config.BotConfig.Balonlyl.TriggerWords {
if strings.Contains(strings.ToLower(update.Message.Text), word) && commonlogic.ContainsInt64(config.BotConfig.Balonlyl.EnabledChats, update.Message.Chat.ID) {
if strings.Contains(strings.ToLower(update.Message.Text), word) && (commonlogic.ContainsInt64(config.BotConfig.Balonlyl.EnabledChats, update.Message.Chat.ID) || update.Message.From.ID == update.Message.Chat.ID) {
isBalonlyl = true
break
}