forked from 39bit/spoilerobot
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for albums #4
Comments
ok thanks ill get back to you tomorrow |
Hello, today is yesterday's tomorrow. |
with bot:
@bot.on(events.NewMessage)
async def handler(event):
async with bot.conversation(event.chat_id) as conv:
await conv.send_message('Send me an album')
items = [await conv.get_response()]
if not items[0].photo:
await conv.send_message("That's not a photo at all")
return
try:
while items[0].grouped_id: # only loop if it's an album
item = await conv.get_response(timeout=0.1)
if item.grouped_id != items[0].grouped_id:
break
items.append(item)
except asyncio.TimeoutError:
pass
await conv.send_message(f'Thank you for your {len(items)} photo(s)')
bot.run_until_disconnected() |
thanks lonami, very cool. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't even know if it's possible. I won't even use it. But you told me to do this:
The text was updated successfully, but these errors were encountered: