Send chat action before uploading photo

This commit is contained in:
Davide Depau 2018-06-24 15:49:08 +02:00
vanhempi 5f898f22bb
commit e55f385f93
Allekirjoittanut: depau
GPG avaimen ID: C7D999B6A55EFE86
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa

Näytä tiedosto

@ -61,11 +61,13 @@ class CallMeByYourBot:
for hashtag in HASHTAGS:
if hashtag.lower() in msg.text.lower():
await methods.sendChatAction(msg.chat.id, 'upload_photo').async_call(self.session, self.token)
send_photo = methods.sendPhoto(chat_id=msg.chat.id)
send_photo.reply_to_message_id = msg.message_id
send_photo.photo = random.choice(HASHTAGS[hashtag])
send_photo.caption = hashtag
resp = await send_photo.async_call(self.session, self.token)
await send_photo.async_call(self.session, self.token)
async def parse_update(self, update: types.Update) -> int:
print(update)