Skip to content

Commit

Permalink
fix: bug and improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Jul 12, 2024
1 parent 46f6246 commit 00fa62b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions hiddifypanel_bot/modules/admin/edit_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,23 @@ async def disable_user_handler(call: HCallbackQuery):


@bot.callback_query_handler(call_action=C.USER_RESET_DAYS, role=Role.AGENT)
async def disable_user_handler(call: HCallbackQuery):
async def reset_days_user_handler(call: HCallbackQuery):
uuid = call.data.split(":")[-1]
user = await call.message.hapi.reset_package_days(uuid)
await send_user_info(call.message, user)
await bot.delete_message(call.message.chat_id, call.message.id)
await bot.answer_callback_query(call.id)

@bot.callback_query_handler(call_action=C.USER_RESET_USAGE, role=Role.AGENT)
async def disable_user_handler(call: HCallbackQuery):
async def reset_usage_user_handler(call: HCallbackQuery):
uuid = call.data.split(":")[-1]
user = await call.message.hapi.reset_traffic(uuid)
await send_user_info(call.message, user)
await bot.delete_message(call.message.chat_id, call.message.id)
await bot.answer_callback_query(call.id)

@bot.callback_query_handler(call_action=C.USER_DELETE, role=Role.AGENT)
async def disable_user_handler(call: HCallbackQuery):
async def delete_user_handler(call: HCallbackQuery):
uuid = call.data.split(":")[-1]
user = await call.message.hapi.delete_user(uuid)
await bot.delete_message(call.message.chat_id, call.message.id)
Expand Down
2 changes: 1 addition & 1 deletion hiddifypanel_bot/modules/admin/search_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import constants as C


@bot.inline_handler(lambda query: query.query.startswith("search"))
@bot.inline_handler(lambda query: query.query.startswith("search"),role=Role.AGENT)
async def handle_inline_query(query: HInlineQuery):
search_query = query.query.lstrip("search").strip()
results = await inline_query(query, search_query)
Expand Down

0 comments on commit 00fa62b

Please sign in to comment.