Run the script as: python chatbot_warmup_task.py
Hi! This is a simple chatbot which translates arabic numbers to roman numbers.
Enter your query (press e to exit): Convert 23 into roman number
XXII
Enter your query (press e to exit): Convert 23, 34 and 760
XXIII XXXIV DCCLX
Enter your query (press e to exit): 42, 8, 90
XLII VIII XC
Enter your query (press e to exit): Hey!
Invalid query
The bot accepts a query from the user. It extracts numbers from the query and converts them into their corresponding roman number. If there are no numbers in the query, it prompts the user to enter a valid query!
About: This is a telegram bot which accesses the QA system of WolframAlpha.
To run this bot, a telegram account would be required. Make a new bot by sending the message "/newbot" to @BotFather on telegram. Store the token received in a secrets.py file (in the same directory where question_answering_bot.py is stored). This token will be used to access the Telegram Bot API.
Now, to access WolframApha's API, get registered on the site and request for a new APP_ID. Store the APP_ID in the secrets.py file where bot's token was saved.
Finally, run the script as: python question_answering_bot.py from the terminal.
- requests
- urllib
Start the conversation with the bot by typing:
q: /start
Hi! I'm a simple Question-Answering bot. Ask me anything you want to or type /commands to check which commands I accept!
q: /commands
Type:
/history - to see your search queries
/bothistory - to see what others searched for
q: What is Brexit?
Looking for a short answer..
No short answer available
Let me search for a descriptive one..
The bot supports inline queries as well, which means from any other chat we can call the bot with its username and ask our query. Eg. @QuesAns_bot President
Snippet of Inline Query: