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:
|
with tempfile.TemporaryDirectory() as d:
|
||||||
fpath = os.path.join(d, '{}.jpg'.format(uuid4()))
|
fpath = os.path.join(d, '{}.jpg'.format(uuid4()))
|
||||||
im.save(fpath)
|
im.save(fpath)
|
||||||
|
if self.queued:
|
||||||
m = bot.send_photo(config.tmp_uploads_chat_id, open(fpath, 'rb'))
|
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 = QueuedItem(config=self, type='photo', args=json.dumps([m.photo[-1].file_id]))
|
||||||
if self.queued:
|
|
||||||
i.save()
|
i.save()
|
||||||
else:
|
else:
|
||||||
i.send(bot)
|
bot.send_photo(self.chat_id, open(fpath, 'rb'))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def periodic_task(self, bot: Bot):
|
def periodic_task(self, bot: Bot):
|
||||||
|
Loading…
Reference in New Issue
Block a user