update db dump command
This commit is contained in:
@@ -236,7 +236,7 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig):
|
||||
update.effective_message.reply_text('GTFO')
|
||||
return
|
||||
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',
|
||||
)
|
||||
|
||||
@@ -267,10 +267,8 @@ class QueuedItem(models.Model):
|
||||
def __json__(self):
|
||||
return {
|
||||
'type': self.type,
|
||||
'args': self.args,
|
||||
'message_id': self.message_id,
|
||||
'message_ids_extra': self.message_ids_extra,
|
||||
'image_hash': self.image_hash,
|
||||
'file_id': json.loads(self.args)[0],
|
||||
'message_ids': [self.message_id] + list(self.message_ids_extra.split('|') if self.message_ids_extra else []),
|
||||
'processed': self.processed,
|
||||
'datetime': self.datetime.isoformat(),
|
||||
}
|
||||
|
Reference in New Issue
Block a user