diff --git a/README.md b/README.md index 2762c1b..856984c 100644 --- a/README.md +++ b/README.md @@ -4,24 +4,190 @@ The plugin-wielding, multi-purpose Telegram bot. Public bot runs on [@mokubot](http://telegram.me/mokubot). -Requires lua-socket and lua-sec. [dkjson](https://github.com/LuaDist/dkjson/) is provided. -Edit config.json with your bot API key, and other API keys if desirable. -Plugins which require an API key are disabled by default. +##Plugins -`lua bot.lua` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
about.lua/aboutInformation about the bot
8ball.lua/8ballMagic 8-ball
bandersnatch.lua/bandersnatchBenedict Cumberbatch name generator
bible.lua/bible <verse>King James Version
btc.lua/btc <currency> [amount]Bitcoin prices and conversion
calc.lua/calc <expression>Solve math expression and convert units
commit.lua/commithttp://whatthecommit.com
dice.lua/roll [arg]Roll a die. Accepts D&D notation
dogify.lua/dogify <lines/separatedby/slashes>Create a doge image
echo.lua/echo <text>Repeat a string
fortune.lua/fortuneRandom fortunes
gSearch.lua/google <query>Google Search
gMaps.lua/loc <location>Google Maps search
gImages.lua/images <query>Google Images search
giphy.lua/giphy [query]Giphy search or random
hackernews.lua/hackernewsTop stories from Hackernews
help.lua/help [command]List commands
hex.lua/hex <number>Convert to and from hexadecimal
imdb.lua/imdb <movie | TV series>IMDb movie/television info
pokedex.lua/dex <pokemon>Pokedex!
pun.lua/punPuns
reddit.lua/reddit [r/subreddit | query]Posts from reddit
remind.lua/remind <delay> <message>Set a reminder for yourself or a group
slap.lua/slap [victim]Slap someone!
time.lua/time <location>Get the time for a place
urbandictionary.lua/ud <term>Urban Dictionary search
weather.lua/weather <location>Get the weather for a place
whoami.lua/whoGet user and group IDs
xkcd.lua/xkcd [search]xkcd strips and alt text
+ + +##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. ###Configuration Most config.json entries are self-explanatory. -Giphy key provided is the public test key, and is subject to rate limitation. +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. -TIME_OFFSET is the time difference, in seconds, between your system clock. It is often necessary for accurate output of the time plugin. +TIME_OFFSET is the time difference, in seconds, between your system clock. It is sometimes necessary for accurate output of the time plugin. Default at 0 (duh). "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: -`"123456789": "foobar"` +`"55994550": "topkecleon"` -ID number must be a string. +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 + +Please do not private message me for support. I will probably block you. + +For support for otouto as well as general Lua and bot assistance, please join the [CIS Bot Development](http://telegram.me/joinchat/05fe39f500f8f1b2d1548147a68acd2a) group. After you read the rules and the pastebin, I will assist you there. diff --git a/bot.lua b/bot.lua index 7516057..74d3159 100644 --- a/bot.lua +++ b/bot.lua @@ -70,6 +70,10 @@ function bot_init() print('Help message generated!\n') + print('username: @'..bot.username) + print('name: '..bot.first_name) + print('ID: '..bot.id) + is_started = true end diff --git a/config.json b/config.json index bba5efd..9bf21d5 100644 --- a/config.json +++ b/config.json @@ -41,7 +41,7 @@ "xkcd.lua" ], "people": { - "0": "nickname", + "55994550": "topkecleon", } } diff --git a/config.json.default b/config.json.default new file mode 100644 index 0000000..9bf21d5 --- /dev/null +++ b/config.json.default @@ -0,0 +1,47 @@ +{ + "BOT_API_KEY": "", + "BIBLIA_API_KEY": "", + "GIPHY_API_KEY": "dc6zaTOxFJmzC", + "TIME_OFFSET": 0, + "admins": [ + 0 + ], + "plugins": [ + "about.lua", + "8ball.lua", + "admin.lua", + "bandersnatch.lua", + "btc.lua", + "calc.lua", + "chatter.lua", + "commit.lua", + "dice.lua", + "dogify.lua", + "echo.lua", + "fortune.lua", + "gImages.lua", + "giphy.lua", + "gMaps.lua", + "gSearch.lua", + "hackernews.lua", + "help.lua", + "hex.lua", + "imdb.lua", + "personality.lua", + "pokedex.lua", + "pun.lua", + "reaction.lua", + "reddit.lua", + "remind.lua", + "slap.lua", + "time.lua", + "urbandictionary.lua", + "weather.lua", + "whoami.lua", + "xkcd.lua" + ], + "people": { + "55994550": "topkecleon", + } +} +