Compare commits

...

2 Commits

Author SHA1 Message Date
Profitroll
a4bbb837d7 Added delay for label setting 2023-01-06 21:27:47 +01:00
Profitroll
1a438fc32e Fixed api method 2023-01-06 21:27:32 +01:00
2 changed files with 3 additions and 1 deletions
classes
modules/handlers

@ -1,4 +1,5 @@
from datetime import datetime
from asyncio import sleep
from traceback import format_exc
from app import app, isAnAdmin
from typing import Any, List, Literal, Union
@ -227,6 +228,7 @@ class HoloUser():
try:
await app.promote_chat_member(configGet("users", "groups"), self.id, privileges=ChatPrivileges(can_pin_messages=True, can_manage_video_chats=True))
if not await isAnAdmin(self.id):
await sleep(0.5)
await app.set_administrator_title(configGet("users", "groups"), self.id, label)
self.set("label", label)
except Exception as exp:

@ -117,7 +117,7 @@ async def confirm_yes(app: Client, msg: Message, kind: Literal["application", "s
else:
sponsorship_content.append(f"{locale(f'question_{question}', 'message', 'sponsor_titles')} {tmp_sponsorship['sponsorship'][question]}")
await app.send_cached_media(chat_id=configGet("admin", "groups"), photo=tmp_sponsorship["sponsorship"]["proof"], caption=(locale("sponsor_got", "message")).format(str(holo_user.id), msg.from_user.first_name, msg.from_user.username, "\n".join(sponsorship_content)), parse_mode=ParseMode.MARKDOWN, reply_markup=InlineKeyboardMarkup(
await app.send_cached_media(configGet("admin", "groups"), tmp_sponsorship["sponsorship"]["proof"], caption=(locale("sponsor_got", "message")).format(str(holo_user.id), msg.from_user.first_name, msg.from_user.username, "\n".join(sponsorship_content)), parse_mode=ParseMode.MARKDOWN, reply_markup=InlineKeyboardMarkup(
[
[
InlineKeyboardButton(text=str(locale("sponsor_yes", "button")), callback_data=f"sponsor_yes_{holo_user.id}")