So user should enter 3 links one by one to bot
And bot should save each link to a new variable (exmp: link1,link2,link3)
Im tried using message handler with iterating,but for some reason it doesnt work
Any workaround?
link1 = ''
link2 = ''
link3 = ''
counter = 1
@dp.message_handler(Text(contains="https://" or "http://",))
async def url(message: types.Message):
if link1 == '':
counter+1
link1 = message.text
elif link2 == '':
counter+1
link2 = message.text
elif link3 == '':
counter+1
link3 = message.text
2
Answers
Got it,
Just need to use States in aiogram.
There’s another good way of doing this if you just want to get multiple links without some specific order.
You need only one state to do this.
Then register handlers which start a conversation
…, append links
… and end the conversation.