Changed config keys
This commit is contained in:
@@ -16,7 +16,7 @@ async def callback_reapply_query_accept(app: Client, clb: CallbackQuery):
|
||||
fullclb = clb.data.split("_")
|
||||
holo_user = HoloUser(int(fullclb[2]))
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("approved_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(configGet("admin", "groups"), locale("approved_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
logWrite(f"User {holo_user.id} got their reapplication approved by {clb.from_user.id}")
|
||||
|
||||
await app.send_message(holo_user.id, locale("approved_joined", "message", locale=holo_user))
|
||||
@@ -32,12 +32,12 @@ async def callback_reapply_query_accept(app: Client, clb: CallbackQuery):
|
||||
|
||||
need_link = True
|
||||
|
||||
async for member in app.get_chat_members(configGet("destination_group")):
|
||||
async for member in app.get_chat_members(configGet("admin", "users")):
|
||||
if member.user.id == holo_user.id:
|
||||
need_link = False
|
||||
|
||||
if need_link:
|
||||
link = await app.create_chat_invite_link(configGet("destination_group"), name=f"Invite for {holo_user.id}", member_limit=1) #, expire_date=datetime.now()+timedelta(days=1))
|
||||
link = await app.create_chat_invite_link(configGet("admin", "users"), name=f"Invite for {holo_user.id}", member_limit=1) #, expire_date=datetime.now()+timedelta(days=1))
|
||||
|
||||
await app.send_message(holo_user.id, locale("read_rules", "message", locale=holo_user))
|
||||
|
||||
@@ -62,7 +62,7 @@ async def callback_query_reapply_reject(app: Client, clb: CallbackQuery):
|
||||
fullclb = clb.data.split("_")
|
||||
holo_user = HoloUser(int(fullclb[2]))
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("rejected_by", "message").format(clb.from_user.first_name, fullclb[2]), disable_notification=True)
|
||||
await app.send_message(configGet("admin", "groups"), locale("rejected_by", "message").format(clb.from_user.first_name, fullclb[2]), disable_notification=True)
|
||||
await app.send_message(holo_user.id, locale("rejected", "message", locale=holo_user))
|
||||
logWrite(f"User {fullclb[2]} got their reapplication rejected by {clb.from_user.id}")
|
||||
|
||||
|
@@ -34,7 +34,7 @@ async def callback_query_sponsor_yes(app: Client, clb: CallbackQuery):
|
||||
fullclb = clb.data.split("_")
|
||||
holo_user = HoloUser(int(fullclb[2]))
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("sponsor_approved_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(configGet("admin", "groups"), locale("sponsor_approved_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(holo_user.id, locale("sponsor_approved", "message", locale=holo_user))
|
||||
logWrite(f"User {holo_user.id} got sponsorship approved by {clb.from_user.id}")
|
||||
|
||||
@@ -67,7 +67,7 @@ async def callback_query_sponsor_yes(app: Client, clb: CallbackQuery):
|
||||
}
|
||||
)
|
||||
|
||||
await holo_user.label_set(configGet("destination_group"), col_tmp.find_one({"user": {"$eq": holo_user.id}, "type": {"$eq": "sponsorship"}})["sponsorship"]["label"])
|
||||
await holo_user.label_set(configGet("admin", "users"), col_tmp.find_one({"user": {"$eq": holo_user.id}, "type": {"$eq": "sponsorship"}})["sponsorship"]["label"])
|
||||
|
||||
edited_markup = [[InlineKeyboardButton(text=str(locale("accepted", "button")), callback_data="nothing")]]
|
||||
|
||||
@@ -80,7 +80,7 @@ async def callback_query_sponsor_no(app: Client, clb: CallbackQuery):
|
||||
fullclb = clb.data.split("_")
|
||||
holo_user = HoloUser(int(fullclb[2]))
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("sponsor_rejected_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(configGet("admin", "groups"), locale("sponsor_rejected_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(holo_user.id, locale("sponsor_rejected", "message", locale=holo_user))
|
||||
logWrite(f"User {holo_user.id} got sponsorship rejected by {clb.from_user.id}")
|
||||
|
||||
|
@@ -15,17 +15,17 @@ async def callback_query_accept(app: Client, clb: CallbackQuery):
|
||||
fullclb = clb.data.split("_")
|
||||
holo_user = HoloUser(int(fullclb[2]))
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("approved_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(configGet("admin", "groups"), locale("approved_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
logWrite(f"User {holo_user.id} got approved by {clb.from_user.id}")
|
||||
|
||||
need_link = True
|
||||
|
||||
async for member in app.get_chat_members(configGet("destination_group")):
|
||||
async for member in app.get_chat_members(configGet("admin", "users")):
|
||||
if member.user.id == holo_user.id:
|
||||
need_link = False
|
||||
|
||||
if need_link:
|
||||
link = await app.create_chat_invite_link(configGet("destination_group"), name=f"Invite for {holo_user.id}", member_limit=1) #, expire_date=datetime.now()+timedelta(days=1))
|
||||
link = await app.create_chat_invite_link(configGet("admin", "users"), name=f"Invite for {holo_user.id}", member_limit=1) #, expire_date=datetime.now()+timedelta(days=1))
|
||||
|
||||
await app.send_message(holo_user.id, locale("read_rules", "message", locale=holo_user))
|
||||
|
||||
@@ -57,7 +57,7 @@ async def callback_query_reject(app: Client, clb: CallbackQuery):
|
||||
fullclb = clb.data.split("_")
|
||||
holo_user = HoloUser(int(fullclb[2]))
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("rejected_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(configGet("admin", "groups"), locale("rejected_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(holo_user.id, locale("rejected", "message", locale=holo_user))
|
||||
logWrite(f"User {holo_user.id} got rejected by {clb.from_user.id}")
|
||||
|
||||
@@ -74,7 +74,7 @@ async def callback_query_reject_aggressive(app: Client, clb: CallbackQuery):
|
||||
fullclb = clb.data.split("_")
|
||||
holo_user = HoloUser(int(fullclb[2]))
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("rejected_by_agr", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(configGet("admin", "groups"), locale("rejected_by_agr", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(holo_user.id, locale("rejected_aggressive", "message", locale=holo_user))
|
||||
logWrite(f"User {holo_user.id} got rejected by {clb.from_user.id} due to being aggressive")
|
||||
|
||||
@@ -91,7 +91,7 @@ async def callback_query_reject_russian(app: Client, clb: CallbackQuery):
|
||||
fullclb = clb.data.split("_")
|
||||
holo_user = HoloUser(int(fullclb[2]))
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("rejected_by_rus", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(configGet("admin", "groups"), locale("rejected_by_rus", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(holo_user.id, locale("rejected_russian", "message", locale=holo_user))
|
||||
logWrite(f"User {holo_user.id} got rejected by {clb.from_user.id} due to being russian")
|
||||
|
||||
|
@@ -13,7 +13,7 @@ async def callback_query_sus_allow(app: Client, clb: CallbackQuery):
|
||||
fullclb = clb.data.split("_")
|
||||
holo_user = HoloUser(int(fullclb[2]))
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("sus_allowed_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(configGet("admin", "groups"), locale("sus_allowed_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
logWrite(f"User {holo_user.id} was allowed to join with another link by {clb.from_user.id}")
|
||||
|
||||
edited_markup = [[InlineKeyboardButton(text=str(locale("sus_allowed", "button")), callback_data="nothing")]]
|
||||
@@ -21,7 +21,7 @@ async def callback_query_sus_allow(app: Client, clb: CallbackQuery):
|
||||
await clb.message.edit(text=clb.message.text, reply_markup=InlineKeyboardMarkup(edited_markup))
|
||||
await clb.answer(text=locale("sus_allowed", "callback", locale=clb.from_user).format(holo_user.id), show_alert=True)
|
||||
|
||||
await app.restrict_chat_member(configGet("destination_group"), holo_user.id, permissions=ChatPermissions(
|
||||
await app.restrict_chat_member(configGet("admin", "users"), holo_user.id, permissions=ChatPermissions(
|
||||
can_send_messages=True,
|
||||
can_send_media_messages=True,
|
||||
can_send_other_messages=True,
|
||||
@@ -35,7 +35,7 @@ async def callback_query_sus_reject(app: Client, clb: CallbackQuery):
|
||||
fullclb = clb.data.split("_")
|
||||
holo_user = HoloUser(int(fullclb[2]))
|
||||
|
||||
await app.send_message(configGet("admin_group"), locale("sus_rejected_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
await app.send_message(configGet("admin", "groups"), locale("sus_rejected_by", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True)
|
||||
logWrite(f"User {holo_user.id} was rejected to join with another link by {clb.from_user.id}")
|
||||
|
||||
edited_markup = [[InlineKeyboardButton(text=str(locale("sus_rejected", "button")), callback_data="nothing")]]
|
||||
@@ -43,7 +43,7 @@ async def callback_query_sus_reject(app: Client, clb: CallbackQuery):
|
||||
await clb.message.edit(text=clb.message.text, reply_markup=InlineKeyboardMarkup(edited_markup))
|
||||
await clb.answer(text=locale("sus_rejected", "callback", locale=clb.from_user).format(holo_user.id), show_alert=True)
|
||||
|
||||
await app.ban_chat_member(configGet("destination_group"), holo_user.id)
|
||||
await app.ban_chat_member(configGet("admin", "users"), holo_user.id)
|
||||
|
||||
col_tmp.update_one({"user": {"$eq": holo_user.id}, "type": {"$eq": "application"}}, {"$set": {"state": "rejected", "sent": False}})
|
||||
# ==============================================================================================================================
|
Reference in New Issue
Block a user