From a48cf6dacc56bddbe7c9fd92abd810c35616f31e Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 1 Feb 2022 03:23:30 +0700 Subject: [PATCH] fixed chat not counted --- program/start.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/program/start.py b/program/start.py index 7d9a212..d3e7bc9 100644 --- a/program/start.py +++ b/program/start.py @@ -14,6 +14,7 @@ from config import ( from program import __version__ from driver.veez import user from driver.filters import command, other_filters +from driver.database.dbchat import add_served_chat, is_served_chat from driver.database.dbpunish import is_gbanned_user from pyrogram import Client, filters from pyrogram import __version__ as pyrover @@ -145,6 +146,11 @@ async def get_uptime(client: Client, message: Message): @Client.on_message(filters.new_chat_members) async def new_chat(c: Client, m: Message): + chat_id = m.chat.id + if await is_served_chat(chat_id): + pass + else: + await add_served_chat(chat_id) ass_uname = (await user.get_me()).username bot_id = (await c.get_me()).id for member in m.new_chat_members: @@ -182,5 +188,5 @@ async def chat_watcher_func(_, message: Message): except Exception: return await message.reply_text( - f"šŸ‘®šŸ¼ (> {suspect} <)\n\n**Gbanned** user joined, that user has been gbanned by sudo user and was blocked from this Chat !\n\nšŸš« **Reason:** potential spammer and abuser." + f"šŸ‘®šŸ¼ (> {suspect} <)\n\n**Gbanned** user detected, that user has been gbanned by sudo user and was blocked from this Chat !\n\nšŸš« **Reason:** potential spammer and abuser." )