So I have limited experience in Java (have some experience with APIs but little experience making bots or clients). However, I have switched to using Telegram instead of iMessage simply because it’s easier to use and more responsive. I also appreciate the open-source nature and the ability for me to create a bot. But I don’t know much in terms of other languages, and am only a student. I was wondering if it was possible to create a bot that, when a certain string is entered, followed by a term, the bot searches Wikipedia and returns the first page that matches the term (or some exception).
Lofty idea… but I have no idea what I’m doing. Does anyone know if there’s a place I could find a tutorial (not Youtube) or if somebody with more knowledge than me (most people who read this) could teach me? That’d be amazing.
My background:
Processing
AP Computer Science A
Limited API use
TL;DR Wikipedia bot for Telegram, need help.
5
Answers
That is possible when you have a specific search term. You can search Wikipedia when you read this:
Do try
To see how to read contents from an url read Java tutorial and then “Java notes v7” book by David J. Eck, section 11.4
It is possible to do it. You can check out this telegram-bot created on github. It’s written in LUA.
The idea you were thinking about has already been done. There’s a plugin for wikipedia using that bot. I suggest reading the source code and from there try to make sense out of it and then try making another plugin on your own referring to the source codes found in the plugin folder.
The Telegram Bot API is now officially available.
Resources:
Maybe this Java API is what you are searching for: TelegramBot JavaAPI
You have to create a class implementing IReceiverService and then something like that:
My simple Java API for Telegram bots
https://github.com/pengrad/java-telegram-bot-api