Photo ID used instead of files for sponsorships
This commit is contained in:
@@ -115,13 +115,11 @@ async def confirm_yes(app: Client, msg: Message, kind: Literal["application", "s
|
||||
if question == "expires":
|
||||
sponsorship_content.append(f"{locale(f'question_{question}', 'message', 'sponsor_titles')} {tmp_sponsorship['sponsorship'][question].strftime('%d.%m.%Y')}")
|
||||
elif question == "proof":
|
||||
filename = uuid1()
|
||||
with open(f"tmp{sep}{filename}.jpg", "wb") as f:
|
||||
f.write(tmp_sponsorship['sponsorship']['proof'])
|
||||
continue
|
||||
else:
|
||||
sponsorship_content.append(f"{locale(f'question_{question}', 'message', 'sponsor_titles')} {tmp_sponsorship['sponsorship'][question]}")
|
||||
|
||||
await app.send_photo(chat_id=configGet("admin", "groups"), photo=f"tmp{sep}{filename}.jpg", 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_photo(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(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(text=str(locale("sponsor_yes", "button")), callback_data=f"sponsor_yes_{holo_user.id}")
|
||||
@@ -133,7 +131,7 @@ async def confirm_yes(app: Client, msg: Message, kind: Literal["application", "s
|
||||
)
|
||||
)
|
||||
|
||||
remove(f"tmp{sep}{filename}.jpg")
|
||||
# remove(f"tmp{sep}{filename}.jpg")
|
||||
|
||||
logWrite(f"User {holo_user.id} sent his sponsorship application and it will now be reviewed")
|
||||
|
||||
|
Reference in New Issue
Block a user