A
A
Adrammelez2017-09-11 18:15:43
Messengers
Adrammelez, 2017-09-11 18:15:43

How to display info from xml upload in telegram bot?

Hello!
Began to write Bota under telegrams. There was a question how to make an output of the information from xml.
Basic with text output when you write hello, he gave out hello, he did it. But I don't really understand how to output information.
There are fields 123.
It is necessary that when requesting a building of class 123, an xml feed is parsed and a random building is output from it, in which there is info.
Please, it is not difficult for anyone to write how it will look like.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Adrammelez, 2017-09-12
@Adrammelez

Who can tell if it's correct?
def answer_message(message):
params = (message.text)
if params = (class B) # this is a test for the entered text
cursor.execute("{CALL getBuildingInfo2 (?)}", params ()) # here we turn to file, the question arose of how to search the file and display a random value according to the input request in params
return_value = cursor.fetchval()
bot.send_message(message.chat.id, return_value)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question