Removed # type: ignore and fixed missing imports
This commit is contained in:
@@ -8,12 +8,12 @@ from modules.handlers.confirmation import confirm_yes
|
||||
from modules.handlers.welcome import welcome_pass
|
||||
|
||||
# Callbacks reapply ============================================================================================================
|
||||
@app.on_callback_query(filters.regex("reapply_yes_[\s\S]*")) # type: ignore
|
||||
@app.on_callback_query(filters.regex("reapply_yes_[\s\S]*"))
|
||||
async def callback_reapply_query_accept(app, clb):
|
||||
|
||||
fullclb = clb.data.split("_")
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("approved_by", "message").format(clb.from_user.first_name, fullclb[2]), disable_notification=True) # type: ignore
|
||||
await app.send_message(configGet("admin_group"), locale("approved_by", "message").format(clb.from_user.first_name, fullclb[2]), disable_notification=True)
|
||||
logWrite(f"User {fullclb[2]} got their reapplication approved by {clb.from_user.id}")
|
||||
|
||||
await app.send_message(int(fullclb[2]), locale("approved_joined", "message"))
|
||||
@@ -30,7 +30,7 @@ async def callback_reapply_query_accept(app, clb):
|
||||
edited_markup = [[InlineKeyboardButton(text=str(locale("accepted", "button")), callback_data="nothing")]]
|
||||
|
||||
await clb.message.edit(text=clb.message.text, reply_markup=InlineKeyboardMarkup(edited_markup))
|
||||
await clb.answer(text=locale("sub_accepted", "callback").format(fullclb[2]), show_alert=True) # type: ignore
|
||||
await clb.answer(text=locale("sub_accepted", "callback").format(fullclb[2]), show_alert=True)
|
||||
|
||||
need_link = True
|
||||
|
||||
@@ -58,12 +58,12 @@ async def callback_reapply_query_accept(app, clb):
|
||||
else:
|
||||
await app.send_message(int(fullclb[2]), locale("approved_joined", "message"))
|
||||
|
||||
@app.on_callback_query(filters.regex("reapply_no_[\s\S]*")) # type: ignore
|
||||
@app.on_callback_query(filters.regex("reapply_no_[\s\S]*"))
|
||||
async def callback_query_reapply_refuse(app, clb):
|
||||
|
||||
fullclb = clb.data.split("_")
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("refused_by", "message").format(clb.from_user.first_name, fullclb[2]), disable_notification=True) # type: ignore
|
||||
await app.send_message(configGet("admin_group"), locale("refused_by", "message").format(clb.from_user.first_name, fullclb[2]), disable_notification=True)
|
||||
await app.send_message(int(fullclb[2]), locale("refused", "message"))
|
||||
logWrite(f"User {fullclb[2]} got their reapplication refused by {clb.from_user.id}")
|
||||
|
||||
@@ -79,20 +79,20 @@ async def callback_query_reapply_refuse(app, clb):
|
||||
edited_markup = [[InlineKeyboardButton(text=str(locale("declined", "button")), callback_data="nothing")]]
|
||||
|
||||
await clb.message.edit(text=clb.message.text, reply_markup=InlineKeyboardMarkup(edited_markup))
|
||||
await clb.answer(text=locale("sub_refused", "callback").format(fullclb[2]), show_alert=True) # type: ignore
|
||||
await clb.answer(text=locale("sub_refused", "callback").format(fullclb[2]), show_alert=True)
|
||||
|
||||
# Use old application when user reapplies after leaving the chat
|
||||
@app.on_callback_query(filters.regex("reapply_old_[\s\S]*")) # type: ignore
|
||||
@app.on_callback_query(filters.regex("reapply_old_[\s\S]*"))
|
||||
async def callback_query_reapply_old(app, clb):
|
||||
fullclb = clb.data.split("_")
|
||||
message = await app.get_messages(clb.from_user.id, int(fullclb[2]))
|
||||
configSet(["approved"], False, file=str(clb.from_user.id))
|
||||
configSet(["refused"], False, file=str(clb.from_user.id))
|
||||
await confirm_yes(app, message)
|
||||
await clb.message.edit(clb.message.text, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("done", "button"), "nothing")]])) # type: ignore
|
||||
await clb.message.edit(clb.message.text, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("done", "button"), "nothing")]]))
|
||||
|
||||
# Start a new application when user reapplies after leaving the chat
|
||||
@app.on_callback_query(filters.regex("reapply_new_[\s\S]*")) # type: ignore
|
||||
@app.on_callback_query(filters.regex("reapply_new_[\s\S]*"))
|
||||
async def callback_query_reapply_new(app, clb):
|
||||
|
||||
fullclb = clb.data.split("_")
|
||||
@@ -106,10 +106,10 @@ async def callback_query_reapply_new(app, clb):
|
||||
message = await app.get_messages(clb.from_user.id, int(fullclb[2]))
|
||||
await welcome_pass(app, message, once_again=True)
|
||||
logWrite(f"User {clb.from_user.id} restarted the application after leaving the chat earlier")
|
||||
await clb.message.edit(clb.message.text, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("done", "button"), "nothing")]])) # type: ignore
|
||||
await clb.message.edit(clb.message.text, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("done", "button"), "nothing")]]))
|
||||
|
||||
# Abort application fill in progress and restart it
|
||||
@app.on_callback_query(filters.regex("reapply_stop_[\s\S]*")) # type: ignore
|
||||
@app.on_callback_query(filters.regex("reapply_stop_[\s\S]*"))
|
||||
async def callback_query_reapply_stop(app, clb):
|
||||
|
||||
fullclb = clb.data.split("_")
|
||||
|
Reference in New Issue
Block a user