Browse Source

Send chat action before uploading photo

master
Davide Depau 1 year ago
parent
commit
e55f385f93
Signed by: Depau <davide@depau.eu> GPG Key ID: C7D999B6A55EFE86
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      callmebyyourbot/__init__.py

+ 3
- 1
callmebyyourbot/__init__.py View File

@@ -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)


Loading…
Cancel
Save