Extract information from the incoming message

(Kopachelli) #1

Hello. I need help. I’m trying to extract information from the received message.

Examples of a message.

First:

Artistic text.

You earned 11 experience and 4 gold coins.

Received: Iron Ore (1)

Received: Branches (1)

Received: Thick fabric (1)

Received: Charcoal (1)

Second:

Artistic text.

You earned 32 experience and 2 gold coins.

Received: Solvent (1)

Received: Animal skins (3)

Goal:

Extract information about receiving items and quantity of each. Can I do that with text (string) or it’s too complicated and I should to use code? When information extracted it will be sent to the database.

(Kopachelli) #2

I’m already play around with text (string), but i can extract only the first line, including the item and (quantity) together.

(Sarah Palombo) #3

Not 100 % on this one but i do have a quick question

How do you receive this information. I think you said through a new message? Is this being passed through a webhook into the bot ? - perhaps you could elaborate for me.

Depends on where you get the details may depend on how best to itemize the lists. Ideally you’d need them as separate outputs to then calculate each [received] item and the [total] of each … The total/quantity could be easy using the number service

Sarah