This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot-2/README.md

307 lines
7.8 KiB
Markdown
Raw Normal View History

2015-07-02 23:39:19 +02:00
# otouto
2015-07-08 04:24:12 +02:00
2015-07-09 04:56:50 +02:00
The plugin-wielding, multi-purpose Telegram bot.
2015-07-08 04:24:12 +02:00
Public bot runs on [@mokubot](http://telegram.me/mokubot).
To start, send "/start" or say "Hello, otouto."
2015-07-11 05:43:30 +02:00
##Plugins
2015-07-11 05:43:30 +02:00
<table>
<thead>
<tr>
2015-07-11 05:43:30 +02:00
<td>about.lua</td>
<td>/about</td>
<td>Information about the bot</td>
</tr>
<tr>
<td>admin.lua</td>
<td>/admin [command]</td>
<td>Support for admin</td>
</tr>
<tr>
<td>bandersnatch.lua</td>
<td>/bandersnatch</td>
<td>Benedict Cumberbatch name generator</td>
</tr>
<tr>
<td>bible.lua</td>
<td>/bible &lt;verse&gt;</td>
<td>King James Version</td>
</tr>
<tr>
<td>blacklist.lua</td>
<td>/blacklist</td>
<td>Blacklist</td>
</tr>
<tr>
<td>btc.lua</td>
<td>/btc &lt;currency&gt; [amount]</td>
<td>Bitcoin prices and conversion</td>
</tr>
<tr>
<td>calc.lua</td>
<td>/calc &lt;expression&gt;</td>
<td>Calculator</td>
</tr>
<tr>
<td>cats.lua</td>
<td>/calc &lt;expression&gt;</td>
<td>Solve math expression and convert units</td>
</tr>
<tr>
<td>chatter.lua</td>
<td>@[user_name_bot], [message]</td>
<td>Chatter Bot</td>
</tr>
<tr>
<td>commit.lua</td>
<td>/commit</td>
<td>http://whatthecommit.com</td>
</tr>
<tr>
<td>currency.lua</td>
<td>/cash &lt;from&gt; &lt;to&gt; [amount]</td>
<td>Convert an amount from one currency to another</td>
</tr>
<tr>
<td>dgmp.lua</td>
<td>/index and /listgroups</td>
<td>Plugin to display the groups, descriptions, etc.</td>
</tr>
<tr>
<td>dice.lua</td>
<td>/roll [arg]</td>
<td>Roll a die. Accepts D&D notation</td>
</tr>
<tr>
<td>dogify.lua</td>
<td>/dogify &lt;lines/separatedby/slashes&gt;</td>
<td>Create a doge image</td>
</tr>
2015-07-11 05:43:30 +02:00
<tr>
<td>echo.lua</td>
<td>/echo &lt;text&gt;</td>
<td>Repeat a string</td>
2015-07-11 05:43:30 +02:00
</tr>
<tr>
<td>floodcontrol.lua</td>
<td>No command</td>
<td>Flood control</td>
2015-07-11 05:43:30 +02:00
</tr>
<tr>
<td>fortune.lua</td>
<td>/fortune</td>
<td>Random fortunes</td>
2015-07-11 05:43:30 +02:00
</tr>
<tr>
<td>gImages.lua</td>
<td>/images &lt;query&gt;</td>
<td>Google Images search</td>
2015-07-11 05:43:30 +02:00
</tr>
<tr>
<td>giphy.lua</td>
<td>/giphy [query]</td>
<td>Giphy search or random</td>
2015-07-11 05:43:30 +02:00
</tr>
<tr>
<td>gMaps.lua</td>
<td>/loc &lt;location&gt;</td>
<td>Google Maps search</td>
2015-07-11 05:43:30 +02:00
</tr>
<tr>
<td>gSearch.lua</td>
<td>/google &lt;query&gt;</td>
<td>Google Search</td>
2015-07-11 05:43:30 +02:00
</tr>
<tr>
<td>hackernews.lua</td>
<td>/hackernews</td>
<td>Top stories from Hackernews</td>
</tr>
<tr>
<td>hearthstone.lua</td>
<td>/hearthstone &lt;card&gt;</td>
<td>Information about a Hearthstone card</td>
</tr>
<tr>
<td>help.lua</td>
<td>/help [command]</td>
<td>List commands</td>
2015-07-11 05:43:30 +02:00
</tr>
<tr>
<td>hex.lua</td>
<td>/hex &lt;number&gt;</td>
<td>Convert to and from hexadecimal</td>
</tr>
<tr>
<td>imdb.lua</td>
<td>/imdb &lt;movie | TV series&gt;</td>
<td>IMDb movie/television info</td>
</tr>
<tr>
<td>interactions.lua</td>
<td>No command</td>
<td>Welcome</td>
</tr>
<tr>
<td>kickass.lua</td>
<td>/torrent &lt;query&gt;</td>
<td>Search Kickass Torrents</td>
</tr>
<tr>
<td>lastfm.lua</td>
<td>/lastfm [username]</td>
<td>Get current- or last-played track</td>
</tr>
<tr>
<td>lmgtfy.lua</td>
<td>/lmgtfy</td>
<td>Open page of lmgtfy</td>
</tr>
<tr>
<td>moderation.lua</td>
<td>/modhelp</td>
<td>Support for moderator or admin</td>
</tr>
<tr>
<td>nick.lua</td>
<td>/nick &lt;nickname&gt;</td>
<td>Set your nickname for the bot</td>
</tr>
<tr>
<td>owm.lua</td>
<td>/weather &lt;location&gt;</td>
<td>Temperature and weather conditions</td>
</tr>
2015-07-11 05:43:30 +02:00
<tr>
<td>pokedex.lua</td>
<td>/dex &lt;pokemon&gt;</td>
<td>Pokedex!</td>
</tr>
<tr>
<td>pun.lua</td>
<td>/pun</td>
<td>Puns</td>
</tr>
<tr>
<td>reaction.lua</td>
<td>/reactions</td>
<td>Get a list emoticons</td>
</tr>
<tr>
<td>reddit.lua</td>
<td>/reddit [r/subreddit | query]</td>
<td>Posts from reddit</td>
</tr>
<tr>
<td>remind.lua</td>
<td>/remind &lt;delay&gt; &lt;message&gt;</td>
<td>Set a reminder for yourself or a group</td>
</tr>
2015-07-11 05:43:30 +02:00
<tr>
<td>slap.lua</td>
<td>/slap [victim]</td>
<td>Slap someone!</td>
</tr>
<tr>
<td>spotify.lua</td>
<td>/spotify &lt;music&gt;</td>
<td>Search Spotify</td>
</tr>
<tr>
<td>time.lua</td>
<td>/time &lt;location&gt;</td>
<td>Get the time for a place</td>
</tr>
<tr>
<td>translate.lua</td>
<td>/translate [target lang]</td>
<td>Message to translate</td>
</tr>
<tr>
<td>urbandictionary.lua</td>
<td>/ud &lt;term&gt;</td>
<td>Urban Dictionary search</td>
</tr>
<tr>
<td>weather.lua</td>
<td>/weather &lt;location&gt;</td>
<td>Get the weather for a place</td>
</tr>
2015-07-11 05:43:30 +02:00
<tr>
<td>whoami.lua</td>
<td>/who</td>
<td>Get user and group IDs</td>
</tr>
2015-10-13 00:41:43 +02:00
<tr>
<td>wikipedia.lua</td>
<td>/wiki &lt;topic&gt;</td>
<td>Search Wikipedia</td>
</tr>
<tr>
<td>xkcd.lua</td>
<td>/xkcd [search]</td>
<td>Xkcd strips and alt text</td>
2015-10-13 00:41:43 +02:00
</tr>
<tr>
<td>youtube.lua</td>
<td>/youtube &lt;query&gt;</td>
<td>Search Youtube</td>
</tr>
<tr>
<td>8ball.lua</td>
<td>/8ball</td>
<td>Magic 8-ball.</td>
</tr>
2015-07-11 05:43:30 +02:00
</tbody>
</table>
2015-07-11 05:43:30 +02:00
##Setup
Requires Lua, lua-socket and lua-sec. [dkjson](http://github.com/LuaDist/dkjson/) is provided. Written for Lua 5.2 but will probably run on 5.3.
You must have a Telegram bot and auth token from the [BotFather](http://telegram.me/botfather) to run this bot. telegram-cli is not required.
2015-07-08 04:24:12 +02:00
###Configuration
To begin, copy config.lua.default to config.lua and add the relevant information.
Most config.lua entries are self-explanatory.
2015-07-08 04:24:12 +02:00
2015-07-11 05:43:30 +02:00
Add your bot API key, and other API keys if desirable.
The plugins which require API keys that are not provided are disabled by default.
The provided Giphy key is the public test key, and is subject to rate limitaton.
The "fortune.lua" plugin requires the fortune program to be installed on the host computer.
"time_offset" is the time difference, in seconds, between your system clock. It is sometimes necessary for accurate output of the time plugin.
2015-07-08 04:24:12 +02:00
"admins" table includes the ID numbers, as integers, of any privileged users. These will have access to the admin plugin and any addition privileged commands.
"people" table is for the personality plugin:
`["55994550"] = "topkecleon"`
2015-07-11 05:43:30 +02:00
ID number must be a string. The second string is the nickname to be given to the identified user when a personality greeting is triggered.
To run:
`lua bot.lua`
##Support
Do not private message me for support.
2015-07-08 09:38:04 +02:00
2015-09-07 20:58:33 +02:00
For support for otouto as well as general Lua and bot assistance, please join the Bot Development group (send "/join 16314802" to [@Liberbot](http://telegram.me/liberbot). After you read the rules and the pastebin, I will assist you there.
2015-09-07 20:57:53 +02:00
###PS
Since there seems to be some confusion on the matter, otouto is **not** a port of yagop's telegram-bot. I am friends with yagop, and he is part of the Bot Development group, but our codebases are and always have been entirely separate. otouto was a CLI bot like telegram-bot before the new API, but they were entirely separate, non-intermingled projects.