feat: more bot variants and ignore leave message if admin deletes message by himself
This commit is contained in:
parent
c8a751b468
commit
8a1cce087d
@ -78,13 +78,23 @@ func CheckUnverifiedUser(ticker *time.Ticker, quitChannel <-chan struct{}, group
|
|||||||
kickMessage := groups[user.GroupID].UserKickMessage
|
kickMessage := groups[user.GroupID].UserKickMessage
|
||||||
kickMessage = message.ReplaceMessage(kickMessage, member.User, groups[user.GroupID])
|
kickMessage = message.ReplaceMessage(kickMessage, member.User, groups[user.GroupID])
|
||||||
|
|
||||||
msg := tgbotapi.NewMessage(user.GroupID, kickMessage)
|
_, err = bot.DeleteMessage(tgbotapi.DeleteMessageConfig{
|
||||||
msg.ParseMode = "Markdown"
|
ChatID: user.GroupID,
|
||||||
_, err = bot.Send(msg)
|
MessageID: user.MessageID,
|
||||||
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("problem while send a message in the verifier:")
|
log.Println("problem while deleting a message in the verifier:")
|
||||||
log.Printf("Problem Error Message: %v", err)
|
log.Println(err)
|
||||||
|
} else {
|
||||||
|
msg := tgbotapi.NewMessage(user.GroupID, kickMessage)
|
||||||
|
msg.ParseMode = "Markdown"
|
||||||
|
_, err = bot.Send(msg)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Println("problem while send a message in the verifier:")
|
||||||
|
log.Printf("Problem Error Message: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kickConfig := tgbotapi.KickChatMemberConfig{
|
kickConfig := tgbotapi.KickChatMemberConfig{
|
||||||
@ -105,15 +115,6 @@ func CheckUnverifiedUser(ticker *time.Ticker, quitChannel <-chan struct{}, group
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = bot.DeleteMessage(tgbotapi.DeleteMessageConfig{
|
|
||||||
ChatID: user.GroupID,
|
|
||||||
MessageID: user.MessageID,
|
|
||||||
})
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Println("problem while deleting a message in the verifier:")
|
|
||||||
log.Println(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,5 +96,13 @@ func hasDrugNames(name string) bool {
|
|||||||
strings.Contains(name, "mdma") ||
|
strings.Contains(name, "mdma") ||
|
||||||
strings.Contains(name, "xanax") ||
|
strings.Contains(name, "xanax") ||
|
||||||
strings.Contains(name, "😘") ||
|
strings.Contains(name, "😘") ||
|
||||||
|
strings.Contains(name, "𝗗𝗘𝗔𝗟𝗘𝗥") ||
|
||||||
|
strings.Contains(name, "𝗪𝗘𝗘𝗗") ||
|
||||||
|
strings.Contains(name, "🥰") ||
|
||||||
|
strings.Contains(name, "😍") ||
|
||||||
|
strings.Contains(name, "COKE") ||
|
||||||
|
strings.Contains(name, "💊") ||
|
||||||
|
strings.Contains(name, "KOKA") ||
|
||||||
|
strings.Contains(name, "WEED") ||
|
||||||
strings.Contains(name, "💊")
|
strings.Contains(name, "💊")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user