Compare commits
3 Commits
b766d0c52c
...
7918049f49
Author | SHA1 | Date | |
---|---|---|---|
|
7918049f49 | ||
|
fcd59b7aca | ||
|
8c478072c6 |
@@ -31,6 +31,10 @@ class PosterClient(Client):
|
|||||||
raise SubmissionUnavailableError()
|
raise SubmissionUnavailableError()
|
||||||
else:
|
else:
|
||||||
filepath = path.join(configGet("data", "locations"), "submissions", db_entry["temp"]["uuid"], db_entry["temp"]["file"])
|
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:
|
else:
|
||||||
try:
|
try:
|
||||||
submission = await self.get_messages(db_entry["user"], db_entry["telegram"]["msg_id"])
|
submission = await self.get_messages(db_entry["user"], db_entry["telegram"]["msg_id"])
|
||||||
|
@@ -70,10 +70,10 @@ async def send_content(app: PosterClient) -> None:
|
|||||||
|
|
||||||
del response
|
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:
|
if submitted is not None and submitted["caption"] is not None:
|
||||||
caption = submitted_caption["caption"].strip()
|
caption = submitted["caption"].strip()
|
||||||
else:
|
else:
|
||||||
caption = ""
|
caption = ""
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ async def send_content(app: PosterClient) -> None:
|
|||||||
"image": pic[0],
|
"image": pic[0],
|
||||||
"filename": pic[1],
|
"filename": pic[1],
|
||||||
"channel": configGet("channel", "posting"),
|
"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()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -7,5 +7,5 @@ from modules.utils import locale
|
|||||||
# Callback empty ===============================================================================================================
|
# Callback empty ===============================================================================================================
|
||||||
@app.on_callback_query(filters.regex("nothing"))
|
@app.on_callback_query(filters.regex("nothing"))
|
||||||
async def callback_query_nothing(app: PosterClient, clb: CallbackQuery):
|
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))
|
||||||
# ==============================================================================================================================
|
# ==============================================================================================================================
|
Reference in New Issue
Block a user