send duplicate original datetime

This commit is contained in:
bakatrouble 2023-07-23 03:07:42 +03:00
parent 3ef196a6ee
commit 8b90a0384a

View File

@ -103,7 +103,7 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig):
duplicate = self.queued_items.filter(image_hash=i.image_hash, type='photo').first()
if duplicate:
try:
update.message.reply_photo(json.loads(duplicate.args)[0], 'Duplicate', quote=True)
update.message.reply_photo(json.loads(duplicate.args)[0], f'Duplicate from {duplicate.datetime}', quote=True)
except:
traceback.print_exc()
update.message.reply_text('Could not send duplicate original', quote=True)
@ -190,6 +190,7 @@ class QueuedItem(models.Model):
message_id = models.PositiveBigIntegerField(default=None, db_index=True, null=True, blank=True)
image_hash = models.CharField(max_length=64, null=True, blank=True)
processed = models.BooleanField(default=False)
datetime = models.DateTimeField(auto_now_add=True)
def send(self, bot: Bot):
if self.type == 'photo' and self.config.should_send_photo_group():