fix not queued rcp uploads
This commit is contained in:
parent
bb3da27f9a
commit
79a512784f
@ -49,12 +49,12 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig):
|
||||
with tempfile.TemporaryDirectory() as d:
|
||||
fpath = os.path.join(d, '{}.jpg'.format(uuid4()))
|
||||
im.save(fpath)
|
||||
m = bot.send_photo(config.tmp_uploads_chat_id, open(fpath, 'rb'))
|
||||
i = QueuedItem(config=self, type='photo', args=json.dumps([m.photo[-1].file_id]))
|
||||
if self.queued:
|
||||
i.save()
|
||||
else:
|
||||
i.send(bot)
|
||||
if self.queued:
|
||||
m = bot.send_photo(config.tmp_uploads_chat_id, open(fpath, 'rb'))
|
||||
i = QueuedItem(config=self, type='photo', args=json.dumps([m.photo[-1].file_id]))
|
||||
i.save()
|
||||
else:
|
||||
bot.send_photo(self.chat_id, open(fpath, 'rb'))
|
||||
return True
|
||||
|
||||
def periodic_task(self, bot: Bot):
|
||||
|
Loading…
Reference in New Issue
Block a user