update db dump command

This commit is contained in:
2025-08-06 23:09:18 +03:00
parent 9a7c0637e2
commit 231d021088

View File

@@ -236,7 +236,7 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig):
update.effective_message.reply_text('GTFO') update.effective_message.reply_text('GTFO')
return return
update.effective_message.reply_document( update.effective_message.reply_document(
BytesIO(json.dumps(list(qi.__json__() for qi in QueuedItem.objects.filter(config=self)), indent=2).encode()), BytesIO(json.dumps(list(qi.__json__() for qi in QueuedItem.objects.filter(config=self, processed=True)), indent=2).encode()),
filename='dump.json', filename='dump.json',
) )
@@ -267,10 +267,8 @@ class QueuedItem(models.Model):
def __json__(self): def __json__(self):
return { return {
'type': self.type, 'type': self.type,
'args': self.args, 'file_id': json.loads(self.args)[0],
'message_id': self.message_id, 'message_ids': [self.message_id] + list(self.message_ids_extra.split('|') if self.message_ids_extra else []),
'message_ids_extra': self.message_ids_extra,
'image_hash': self.image_hash,
'processed': self.processed, 'processed': self.processed,
'datetime': self.datetime.isoformat(), 'datetime': self.datetime.isoformat(),
} }