Skip to content

Commit

Permalink
Update users.py
Browse files Browse the repository at this point in the history
  • Loading branch information
markjohanson183 authored May 20, 2023
1 parent 88d7db2 commit 87f7068
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions bot/modules/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from bot import config_dict, dispatcher, OWNER_ID
from bot.helper.telegram_helper.filters import CustomFilters
from bot.helper.telegram_helper.message_utils import sendMessage, sendPhoto
from bot.helper.telegram_helper.bot_commands import BotCommands
from bot.helper.telegram_helper.message_utils import sendMessage, sendPhoto

def dbusers(update, context):
if not config_dict['DATABASE_URL']:
Expand Down Expand Up @@ -41,24 +41,28 @@ def bot_limit(update, context):
total_task = 'No Limit Set' if TOTAL_TASKS_LIMIT == '' else f'{TOTAL_TASKS_LIMIT} Total Tasks/Time'
user_task = 'No Limit Set' if USER_TASKS_LIMIT == '' else f'{USER_TASKS_LIMIT} Tasks/user'

limit = f"<b>🔢 Bot Limitations </b>\n\n"\
f"Torrent/Direct: {torrent_direct}\n"\
f"Zip/Unzip: {zip_unzip}\n"\
f"Leech: {leech_limit}\n"\
f"Clone: {clone_limit}\n"\
f"Mega: {mega_limit}\n"\
f"Total Tasks: {total_task}\n"\
f"User Tasks: {user_task}\n\n"
limit = f"<b>BOT LIMITATIONS:</b>\n\n"\
f"<b>• Torrent-Direct:</b> {torrent_direct}\n"\
f"<b>• Zip-Unzip:</b> {zip_unzip}\n"\
f"<b>• Leech:</b> {leech_limit}\n"\
f"<b>• Clone:</b> {clone_limit}\n"\
f"<b>• Mega:</b> {mega_limit}\n"\
f"<b>• Total Tasks:</b> {total_task}\n"\
f"<b>• User Tasks:</b> {user_task}\n\n"

if config_dict['PICS']:
sendPhoto(limit, context.bot, update.message, rchoice(config_dict['PICS']))
else:
sendMessage(limit, context.bot, update.message)


if config_dict['IS_PUBLIC_BOT']:
limit_handler = CommandHandler(BotCommands.LimitCommand, bot_limit)
else:
limit_handler = CommandHandler(BotCommands.LimitCommand, bot_limit, filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)

dbusers_handler = CommandHandler("dbusers", dbusers, filters=CustomFilters.owner_filter | CustomFilters.sudo_user)
id_handler = CommandHandler("id", get_id)
limit_handler = CommandHandler(BotCommands.LimitCommand, bot_limit,
filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)

dispatcher.add_handler(dbusers_handler)
dispatcher.add_handler(id_handler)
Expand Down

0 comments on commit 87f7068

Please sign in to comment.