minor improve
This commit is contained in:
+4
-4
@@ -69,19 +69,19 @@ def send_rules(message):
|
|||||||
if len(args) > 1 and args[-1].isdigit() and 0 < int(args[-1]):
|
if len(args) > 1 and args[-1].isdigit() and 0 < int(args[-1]):
|
||||||
send_or_reply(message, f'<b>Правило {args[-1]}</b>\n<i>{rules.fetch_rule(args[-1])}</i>', reply_markup=markup)
|
send_or_reply(message, f'<b>Правило {args[-1]}</b>\n<i>{rules.fetch_rule(args[-1])}</i>', reply_markup=markup)
|
||||||
else:
|
else:
|
||||||
send_or_reply(message, '⤵️', reply_markup=markup)
|
send_or_reply(message, '...', reply_markup=markup)
|
||||||
|
|
||||||
|
|
||||||
@bot.message_handler(commands=['faq', 'чзв'])
|
@bot.message_handler(commands=['faq', 'чзв'])
|
||||||
def send_faq(message):
|
def send_faq(message):
|
||||||
markup = types.InlineKeyboardMarkup([[FAQ]], 1)
|
markup = types.InlineKeyboardMarkup([[FAQ]], 1)
|
||||||
send_or_reply(message, '⤵️', reply_markup=markup)
|
send_or_reply(message, '...', reply_markup=markup)
|
||||||
|
|
||||||
|
|
||||||
@bot.message_handler(commands=['lib', 'library', 'books', 'книги', 'библиотека'])
|
@bot.message_handler(commands=['lib', 'library', 'books', 'книги', 'библиотека'])
|
||||||
def send_lib(message):
|
def send_lib(message):
|
||||||
markup = types.InlineKeyboardMarkup([[LIB]], 1)
|
markup = types.InlineKeyboardMarkup([[LIB]], 1)
|
||||||
send_or_reply(message, '⤵️', reply_markup=markup)
|
send_or_reply(message, '...', reply_markup=markup)
|
||||||
|
|
||||||
|
|
||||||
@bot.message_handler(commands=['lutz', 'лутц'])
|
@bot.message_handler(commands=['lutz', 'лутц'])
|
||||||
@@ -167,7 +167,7 @@ def google_it(message: types.Message):
|
|||||||
|
|
||||||
markup = types.InlineKeyboardMarkup()
|
markup = types.InlineKeyboardMarkup()
|
||||||
markup.add(types.InlineKeyboardButton('🔍 Google Поиск', url=get_query), row_width=1)
|
markup.add(types.InlineKeyboardButton('🔍 Google Поиск', url=get_query), row_width=1)
|
||||||
send_or_reply(message, f'<i>Ищем «{query}» в Гугле...</i>', reply_markup=markup)
|
send_or_reply(message, f'<i>Ищем «{query}»...</i>', reply_markup=markup)
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|||||||
+2
-3
@@ -10,8 +10,7 @@ def create_report_text(chat_id):
|
|||||||
if os.path.exists(f'{DATA}{chat_id}.db'):
|
if os.path.exists(f'{DATA}{chat_id}.db'):
|
||||||
with shelve.open(f'{DATA}{chat_id}') as s:
|
with shelve.open(f'{DATA}{chat_id}') as s:
|
||||||
for n in range(min(3, len(s['Messages']))):
|
for n in range(min(3, len(s['Messages']))):
|
||||||
top_user = s['Messages'][
|
top_user = s['Messages'][sorted(s['Messages'], key=lambda a: s['Messages'][a]['Count'], reverse=True)[n]]
|
||||||
sorted(s['Messages'], key=lambda a: s['Messages'][a]['Count'], reverse=True)[n]]
|
|
||||||
if top_user['Count'] >= 10:
|
if top_user['Count'] >= 10:
|
||||||
flooders.append(top_user)
|
flooders.append(top_user)
|
||||||
|
|
||||||
@@ -21,13 +20,13 @@ def create_report_text(chat_id):
|
|||||||
top_users += f'\n {i + 1}. <a href="tg://user?id={user.id}">{name}</a> ({flooder["Count"]})'
|
top_users += f'\n {i + 1}. <a href="tg://user?id={user.id}">{name}</a> ({flooder["Count"]})'
|
||||||
|
|
||||||
if s['Banned'] or s['Deleted']:
|
if s['Banned'] or s['Deleted']:
|
||||||
report = f"<code>Hello, World!</code> 🌍\n"
|
|
||||||
report += f"""
|
report += f"""
|
||||||
<b>Заблокировано</b> ⛔
|
<b>Заблокировано</b> ⛔
|
||||||
├ <b>Пользователей: </b>{s['Banned']}
|
├ <b>Пользователей: </b>{s['Banned']}
|
||||||
└ <b>Сообщений: </b>{s['Deleted']}
|
└ <b>Сообщений: </b>{s['Deleted']}
|
||||||
"""
|
"""
|
||||||
if len(flooders) >= 3:
|
if len(flooders) >= 3:
|
||||||
|
report += f"<code>Hello, World!</code> 🌍"
|
||||||
report += f"\n<b>Топ</b> 🗣{top_users}"
|
report += f"\n<b>Топ</b> 🗣{top_users}"
|
||||||
return report
|
return report
|
||||||
else:
|
else:
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
""" Stan quote generator. """
|
""" Stan's commands and reactions. """
|
||||||
import random
|
import random
|
||||||
from .config import bot, types
|
from .config import bot, types
|
||||||
from .filters import is_white, is_nongrata
|
from .filters import is_white, is_nongrata
|
||||||
|
|||||||
Reference in New Issue
Block a user