Lately, I'm looking for something that will make me busy aside from playing games. Heh. I have been wanting to create a bot for a long time but I really don't know what kind of bot I want to make (definitely not something like simsimi. Too advanced for me). Since public schools are about to open here in our place, I decided to create something that might help students with limited internet access and are relying on free data.

We are on viber! Here's the link.

Please

The commands start with the word "please",  why? I just feel like it, heh. The intention is  to have a term that will identify that the user entered a command and maybe in the future, have a distinction for other terms.

In any case, it is required and if you're feeling lazy, the chatbot also accepts "pls". Let's practice asking politely 'kay? Because bots have feelings too!

Commands

Currently there are three commands available for the chatbot.

  • please search ${article name}
  • please define ${word}
  • please calculate ${expression}
  • please translate ${text}

The search command is the shortcut of please search:wikipedia ${article name} command. The :wikipedia is in preparation for other sources that might be added in the future. By default, the command uses wikipedia's opensearch API to search for wikipedia article by title. The chatbot will respond with the article sections with one caveat; the sections are cut when there are multiple items under the section. I'm planning to improve the experience in the future, hopefully. heh.

Define

This command uses owlbot's API  to search for the definition of the word by default. Oxford Dictionary's API would've been good but meh, their free tier only has 1000 request limit per month.

Will add urban dictionary source soon. 😏

Calculate

I find this command the most interesting because it can evaluate so many mathematical expressions. I used mathjs for the functionality with some tweaks. It supports basic math expressions, unit conversions, and some algebra functions.

Shortcut: please calc ${expression}

Translate

Translate uses google translate in the background. It auto detects the source language and translates the text to english by default. If you want to be more specific, the command can accept the target and source language by following this pattern: please translate:{target}:{source} Text.

So if for example, you want to translate Hello to Japanese you'd want to enter the following command, please translate:ja Hello or with the source, please translate:ja:en Hello.

Below is the long list of the codes for the available languages.

  • auto - Automatic
  • af - Afrikaans
  • sq - Albanian
  • am - Amharic
  • ar - Arabic
  • hy - Armenian
  • az - Azerbaijani
  • eu - Basque
  • be - Belarusian
  • bn - Bengali
  • bs - Bosnian
  • bg - Bulgarian
  • ca - Catalan
  • ceb - Cebuano
  • ny - Chichewa
  • zh-CN - Chinese (Simplified)
  • zh-TW - Chinese (Traditional)
  • co - Corsican
  • hr - Croatian
  • cs - Czech
  • da - Danish
  • nl - Dutch
  • en - English
  • eo - Esperanto
  • et - Estonian
  • tl - Filipino
  • fi - Finnish
  • fr - French
  • fy - Frisian
  • gl - Galician
  • ka - Georgian
  • de - German
  • el - Greek
  • gu - Gujarati
  • ht - Haitian Creole
  • ha - Hausa
  • haw - Hawaiian
  • he - Hebrew
  • iw - Hebrew
  • hi - Hindi
  • hmn - Hmong
  • hu - Hungarian
  • is - Icelandic
  • ig - Igbo
  • id - Indonesian
  • ga - Irish
  • it - Italian
  • ja - Japanese
  • jw - Javanese
  • kn - Kannada
  • kk - Kazakh
  • km - Khmer
  • ko - Korean
  • ku - Kurdish (Kurmanji)
  • ky - Kyrgyz
  • lo - Lao
  • la - Latin
  • lv - Latvian
  • lt - Lithuanian
  • lb - Luxembourgish
  • mk - Macedonian
  • mg - Malagasy
  • ms - Malay
  • ml - Malayalam
  • mt - Maltese
  • mi - Maori
  • mr - Marathi
  • mn - Mongolian
  • my - Myanmar (Burmese)
  • ne - Nepali
  • no - Norwegian
  • ps - Pashto
  • fa - Persian
  • pl - Polish
  • pt - Portuguese
  • pa - Punjabi
  • ro - Romanian
  • ru - Russian
  • sm - Samoan
  • gd - Scots Gaelic
  • sr - Serbian
  • st - Sesotho
  • sn - Shona
  • sd - Sindhi
  • si - Sinhala
  • sk - Slovak
  • sl - Slovenian
  • so - Somali
  • es - Spanish
  • su - Sundanese
  • sw - Swahili
  • sv - Swedish
  • tg - Tajik
  • ta - Tamil
  • te - Telugu
  • th - Thai
  • tr - Turkish
  • uk - Ukrainian
  • ur - Urdu
  • uz - Uzbek
  • vi - Vietnamese
  • cy - Welsh
  • xh - Xhosa
  • yi - Yiddish
  • yo - Yoruba
  • zu - Zul

Chatbot in Action!

Embedding a facebook video is not working apparently. Maybe I'm doing it wrong but anyways here's the link to the video: https://www.facebook.com/littlekenneth.xyz/videos/400681064659116/.