How to read user input in Python message VK API?

The problem is, the user writes /shop and it shows that you can buy.
He can buy any item(and any number) how to find out what subject and what number the user entered, then to process this information.

elif body.lower() == '/shop':
 vk.method('messages.send', {'peer_id': id, 'message': 'available: carrots - price: 10'
 + '\n' + 'to buy write /buy (item) (Qty)'})

elif body.lower() == '/buy (item) (Qty)':
 vk.method('messages.send', {'peer_id': id, 'message': 'test'})
June 4th 19 at 16:48
1 answer
June 4th 19 at 16:50
object number = body.lower().split(' ')[1:3]
In this case, if the name of the object without spaces.
Thank you very much. - Dalton.Kloc commented on June 4th 19 at 16:53

Find more questions by tags PythonAPIVKontakte