Removed # type: ignore and fixed missing imports

This commit is contained in:
2022-12-06 10:26:22 +01:00
parent 712b5d22ab
commit 65f6b4e30e
19 changed files with 92 additions and 89 deletions

View File

@@ -5,18 +5,18 @@ from pyrogram import filters
from modules.utils import configGet, configSet, jsonLoad, jsonSave, locale, logWrite
# Callbacks sus users ==========================================================================================================
@app.on_callback_query(filters.regex("sus_allow_[\s\S]*")) # type: ignore
@app.on_callback_query(filters.regex("sus_allow_[\s\S]*"))
async def callback_query_sus_allow(app, clb):
fullclb = clb.data.split("_")
await app.send_message(configGet("admin_group"), locale("sus_allowed_by", "message").format(clb.from_user.first_name, fullclb[2]), disable_notification=True) # type: ignore
await app.send_message(configGet("admin_group"), locale("sus_allowed_by", "message").format(clb.from_user.first_name, fullclb[2]), disable_notification=True)
logWrite(f"User {fullclb[2]} was allowed to join with another link by {clb.from_user.id}")
edited_markup = [[InlineKeyboardButton(text=str(locale("sus_allowed", "button")), callback_data="nothing")]]
await clb.message.edit(text=clb.message.text, reply_markup=InlineKeyboardMarkup(edited_markup))
await clb.answer(text=locale("sus_allowed", "callback").format(fullclb[2]), show_alert=True) # type: ignore
await clb.answer(text=locale("sus_allowed", "callback").format(fullclb[2]), show_alert=True)
await app.restrict_chat_member(configGet("destination_group"), int(fullclb[2]), permissions=ChatPermissions(
can_send_messages=True,
@@ -26,18 +26,18 @@ async def callback_query_sus_allow(app, clb):
)
)
@app.on_callback_query(filters.regex("sus_refuse_[\s\S]*")) # type: ignore
@app.on_callback_query(filters.regex("sus_refuse_[\s\S]*"))
async def callback_query_sus_refuse(app, clb):
fullclb = clb.data.split("_")
await app.send_message(configGet("admin_group"), locale("sus_refused_by", "message").format(clb.from_user.first_name, fullclb[2]), disable_notification=True) # type: ignore
await app.send_message(configGet("admin_group"), locale("sus_refused_by", "message").format(clb.from_user.first_name, fullclb[2]), disable_notification=True)
logWrite(f"User {fullclb[2]} was refused to join with another link by {clb.from_user.id}")
edited_markup = [[InlineKeyboardButton(text=str(locale("sus_refused", "button")), callback_data="nothing")]]
await clb.message.edit(text=clb.message.text, reply_markup=InlineKeyboardMarkup(edited_markup))
await clb.answer(text=locale("sus_refused", "callback").format(fullclb[2]), show_alert=True) # type: ignore
await clb.answer(text=locale("sus_refused", "callback").format(fullclb[2]), show_alert=True)
await app.ban_chat_member(configGet("destination_group"), int(fullclb[2]))