format Black

This commit is contained in:
Rykov7
2023-02-22 18:53:12 +03:00
parent 23a93b5dbd
commit d0cf0762c8
13 changed files with 356 additions and 205 deletions
+26 -19
View File
@@ -10,20 +10,20 @@ from ..filters import is_admin
from .get import me, my_ip
@bot.message_handler(commands=['me'])
@bot.message_handler(commands=["me"])
def command_me(message):
""" Send info about user and chat id [Service]. """
"""Send info about user and chat id [Service]."""
bot.send_message(message.chat.id, me(message))
@bot.message_handler(func=is_admin, commands=['ip'])
@bot.message_handler(func=is_admin, commands=["ip"])
def get_ip(message):
bot.send_message(message.chat.id, my_ip())
@bot.message_handler(commands=['remind'])
@bot.message_handler(commands=["remind"])
def remind_manually(message):
""" Remind holidays manually. """
"""Remind holidays manually."""
args = message.text.split()
if len(args) > 1:
try:
@@ -33,38 +33,45 @@ def remind_manually(message):
else:
reminder.remind(message.chat.id, today)
else:
bot.send_message(message.chat.id, f"<b>Формат даты: MM-DD-YYYY</b>\n\n"
f"Примеры:\n"
f"/remind 09-12-2024\n"
f"/remind 09-13-2022")
bot.send_message(
message.chat.id,
f"<b>Формат даты: MM-DD-YYYY</b>\n\n"
f"Примеры:\n"
f"/remind 09-12-2024\n"
f"/remind 09-13-2022",
)
@bot.message_handler(func=is_admin, commands=['jobs'])
@bot.message_handler(func=is_admin, commands=["jobs"])
def list_jobs(message):
""" List all the jobs in schedule. """
"""List all the jobs in schedule."""
bot.send_message(ADMIN_ID, reminder.print_get_jobs())
@bot.message_handler(func=is_admin, commands=['stats'])
@bot.message_handler(func=is_admin, commands=["stats"])
def send_stats(message: types.Message):
if len(message.text.split()) == 1:
rep = report.create_report_text(message.chat.id)
if rep:
bot.send_message(message.chat.id, rep)
else:
bot.send_message(message.chat.id, report.create_report_text(message.text.split()[-1]))
bot.send_message(
message.chat.id, report.create_report_text(message.text.split()[-1])
)
@bot.message_handler(func=is_admin, commands=['reset_stats'], chat_types=['supergroup', 'group'])
@bot.message_handler(
func=is_admin, commands=["reset_stats"], chat_types=["supergroup", "group"]
)
def send_stats(message: types.Message):
logging.warning('reset_stats')
logging.warning("reset_stats")
report.reset_report_stats(message.chat.id)
bot.send_message(message.chat.id, report.reset_report_stats(message.chat.id))
@bot.message_handler(func=is_admin, commands=['reload'])
@bot.message_handler(func=is_admin, commands=["reload"])
def send_stats(message):
logging.warning('Reloading...')
logging.warning("Reloading...")
reloader.reload_modules()
logging.warning('Reloaded!!!')
bot.send_message(message.chat.id, 'Reloaded successfully')
logging.warning("Reloaded!!!")
bot.send_message(message.chat.id, "Reloaded successfully")