Compare commits

...

3 Commits

Author SHA1 Message Date
Profitroll
7918049f49 Fixed language code typo 2023-02-17 23:18:54 +01:00
Profitroll
fcd59b7aca Fixed caption display 2023-02-17 23:18:34 +01:00
Profitroll
8c478072c6 Fixed reply message not getting quoted 2023-02-17 23:18:19 +01:00
3 changed files with 9 additions and 5 deletions

View File

@@ -31,6 +31,10 @@ class PosterClient(Client):
raise SubmissionUnavailableError()
else:
filepath = path.join(configGet("data", "locations"), "submissions", db_entry["temp"]["uuid"], db_entry["temp"]["file"])
try:
submission = await self.get_messages(db_entry["user"], db_entry["telegram"]["msg_id"])
except:
pass
else:
try:
submission = await self.get_messages(db_entry["user"], db_entry["telegram"]["msg_id"])

View File

@@ -70,10 +70,10 @@ async def send_content(app: PosterClient) -> None:
del response
submitted_caption = col_submitted.find_one( {"temp.file": pic[1]} )
submitted = col_submitted.find_one({"temp.file": pic[1]})
if submitted_caption is not None:
caption = submitted_caption["caption"].strip()
if submitted is not None and submitted["caption"] is not None:
caption = submitted["caption"].strip()
else:
caption = ""
@@ -100,7 +100,7 @@ async def send_content(app: PosterClient) -> None:
"image": pic[0],
"filename": pic[1],
"channel": configGet("channel", "posting"),
"caption": None if submitted_caption is None else submitted_caption["caption"].strip()
"caption": None if (submitted is None or submitted["caption"] is None) else submitted["caption"].strip()
}
)

View File

@@ -7,5 +7,5 @@ from modules.utils import locale
# Callback empty ===============================================================================================================
@app.on_callback_query(filters.regex("nothing"))
async def callback_query_nothing(app: PosterClient, clb: CallbackQuery):
await clb.answer(text=locale("nothing", "callback", locale=clb.from_user))
await clb.answer(text=locale("nothing", "callback", locale=clb.from_user.language_code))
# ==============================================================================================================================