send duplicate original datetime
This commit is contained in:
parent
3ef196a6ee
commit
8b90a0384a
@ -103,7 +103,7 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig):
|
|||||||
duplicate = self.queued_items.filter(image_hash=i.image_hash, type='photo').first()
|
duplicate = self.queued_items.filter(image_hash=i.image_hash, type='photo').first()
|
||||||
if duplicate:
|
if duplicate:
|
||||||
try:
|
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:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
update.message.reply_text('Could not send duplicate original', quote=True)
|
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)
|
message_id = models.PositiveBigIntegerField(default=None, db_index=True, null=True, blank=True)
|
||||||
image_hash = models.CharField(max_length=64, null=True, blank=True)
|
image_hash = models.CharField(max_length=64, null=True, blank=True)
|
||||||
processed = models.BooleanField(default=False)
|
processed = models.BooleanField(default=False)
|
||||||
|
datetime = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
def send(self, bot: Bot):
|
def send(self, bot: Bot):
|
||||||
if self.type == 'photo' and self.config.should_send_photo_group():
|
if self.type == 'photo' and self.config.should_send_photo_group():
|
||||||
|
Loading…
Reference in New Issue
Block a user