make message counter to check chat
This commit is contained in:
+7
-2
@@ -10,7 +10,7 @@ import shelve
|
||||
from . import report
|
||||
from .query_log import logging
|
||||
from .me import get_me
|
||||
from .config import bot, ADMIN_ID, TOKEN
|
||||
from .config import bot, ADMIN_ID, TOKEN, PYTHONCHATRU
|
||||
from . import reminder
|
||||
|
||||
# https://core.telegram.org/bots/api Telegram Bot API
|
||||
@@ -215,7 +215,12 @@ def unwanted_mentions(message: types.Message):
|
||||
bot.reply_to(message, f'У нас таких не любят! 🥴', parse_mode='HTML')
|
||||
|
||||
|
||||
@bot.message_handler(func=lambda a: True)
|
||||
def check_chat(message: types.Message):
|
||||
if message.chat.id == PYTHONCHATRU:
|
||||
return True
|
||||
|
||||
|
||||
@bot.message_handler(func=check_chat)
|
||||
def unwanted_mentions(message: types.Message):
|
||||
""" Count messages. """
|
||||
with shelve.open('chat_stats', writeback=True) as s:
|
||||
|
||||
+2
-3
@@ -14,9 +14,8 @@ def create_report_text():
|
||||
name = flooder['Name']
|
||||
count = flooder['Count']
|
||||
text += f'\n {i + 1}. <a href="https://t.me/{username}">{name}</a> ({count})'
|
||||
report = f"""<code>Доброе утро, мир!</code>
|
||||
|
||||
<b>ЗА ПРОШЕДШИЕ СУТКИ:</b>
|
||||
report = f"""<code>Доброе утро, Мир!</code>
|
||||
<b>За прошедшие сутки</b>
|
||||
|
||||
👮🏼 <b>Заблокировано</b>
|
||||
├ <b>Пользователей: </b>{s['Banned']}
|
||||
|
||||
Reference in New Issue
Block a user