Fixed caption being added explicitly
This commit is contained in:
@@ -139,7 +139,7 @@ class PyroClient(PyroClient):
|
||||
await super().stop()
|
||||
|
||||
async def submit_media(
|
||||
self, id: str
|
||||
self, id: str, purge_caption: bool = False
|
||||
) -> Tuple[Union[Message, None], Union[str, None]]:
|
||||
db_entry = await col_submitted.find_one({"_id": ObjectId(id)})
|
||||
submission = None
|
||||
@@ -224,7 +224,13 @@ class PyroClient(PyroClient):
|
||||
)
|
||||
raise SubmissionDuplicatesError(str(filepath), duplicates)
|
||||
|
||||
await col_submitted.update_one({"_id": ObjectId(id)}, {"$set": {"done": True}})
|
||||
db_update = (
|
||||
{"$set": {"done": True, "caption": None}}
|
||||
if purge_caption
|
||||
else {"$set": {"done": True}}
|
||||
)
|
||||
|
||||
await col_submitted.update_one({"_id": ObjectId(id)}, db_update)
|
||||
|
||||
try:
|
||||
if db_entry["temp"]["uuid"] is not None:
|
||||
|
Reference in New Issue
Block a user