make brayden's stuff work

This commit is contained in:
topkecleon 2016-06-07 00:31:34 -04:00
parent a97457aa01
commit 6fc5320198
53 changed files with 66 additions and 66 deletions

View File

@ -8,8 +8,8 @@ bot.version = '3.9'
function bot:init(config) -- The function run when the bot is started or reloaded.
bindings = require('bindings')
utilities = require('utilities')
bindings = require('otouto.bindings')
utilities = require('otouto.utilities')
assert(
config.bot_api_key and config.bot_api_key ~= '',
@ -34,7 +34,7 @@ function bot:init(config) -- The function run when the bot is started or reloade
self.plugins = {} -- Load plugins.
for _,v in ipairs(config.plugins) do
local p = require('plugins.'..v)
local p = require('otouto.plugins.'..v)
table.insert(self.plugins, p)
if p.init then p.init(self, config) end
end

View File

@ -1,7 +1,7 @@
local about = {}
local bot = require('bot')
local utilities = require('utilities')
local bot = require('otouto.bot')
local utilities = require('otouto.utilities')
about.command = 'about'
about.doc = '`Returns information about the bot.`'

View File

@ -43,8 +43,8 @@
local JSON = require('dkjson')
local drua = dofile('drua-tg.lua')
local bindings = require('bindings')
local utilities = require('utilities')
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
local administration = {}

View File

@ -5,7 +5,7 @@ local apod = {}
local HTTPS = require('ssl.https')
local JSON = require('dkjson')
local URL = require('socket.url')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
apod.command = 'apod [date]'

View File

@ -1,6 +1,6 @@
local bandersnatch = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
bandersnatch.command = 'bandersnatch'

View File

@ -2,7 +2,7 @@ local bible = {}
local HTTP = require('socket.http')
local URL = require('socket.url')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function bible:init(config)
if not config.biblia_api_key then

View File

@ -8,7 +8,7 @@ local JSON = require('dkjson')
local mime = require('mime')
local https = require('ssl.https')
local ltn12 = require('ltn12')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
bing.command = 'bing <query>'
bing.doc = [[```

View File

@ -3,7 +3,7 @@
local blacklist = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function blacklist:init()
if not self.database.blacklist then

View File

@ -2,7 +2,7 @@ local calc = {}
local URL = require('socket.url')
local HTTPS = require('ssl.https')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
calc.command = 'calc <expression>'

View File

@ -1,7 +1,7 @@
local cats = {}
local HTTP = require('socket.http')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function cats:init(config)
if not config.thecatapi_key then

View File

@ -1,7 +1,7 @@
local channel = {}
local bindings = require('bindings')
local utilities = require('utilities')
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
--channel.command = 'ch <channel> \\n <message>'
channel.doc = [[```

View File

@ -5,7 +5,7 @@ local chatter = {}
local HTTP = require('socket.http')
local URL = require('socket.url')
local JSON = require('dkjson')
local bindings = require('bindings')
local bindings = require('otouto.bindings')
function chatter:init(config)
if not config.simsimi_key then

View File

@ -2,7 +2,7 @@
local commit = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
commit.command = 'commit'
commit.doc = '`Returns a commit message from whatthecommit.com.`'

View File

@ -1,7 +1,7 @@
local control = {}
local bot = require('bot')
local utilities = require('utilities')
local bot = require('otouto.bot')
local utilities = require('otouto.utilities')
local cmd_pat -- Prevents the command from being uncallable.

View File

@ -1,7 +1,7 @@
local currency = {}
local HTTPS = require('ssl.https')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
currency.command = 'cash [amount] <from> to <to>'

View File

@ -1,6 +1,6 @@
local dice = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
dice.command = 'roll <nDr>'

View File

@ -2,8 +2,8 @@ local dilbert = {}
local HTTP = require('socket.http')
local URL = require('socket.url')
local bindings = require('bindings')
local utilities = require('utilities')
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
dilbert.command = 'dilbert [date]'

View File

@ -1,6 +1,6 @@
local echo = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
echo.command = 'echo <text>'

View File

@ -1,6 +1,6 @@
local eightball = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
eightball.command = '8ball'
eightball.doc = '`Returns an answer from a magic 8-ball!`'

View File

@ -2,7 +2,7 @@
local fortune = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function fortune:init(config)
local s = io.popen('fortune'):read('*all')

View File

@ -6,7 +6,7 @@ local gImages = {}
local HTTPS = require('ssl.https')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function gImages:init(config)
if not config.google_api_key then

View File

@ -1,7 +1,7 @@
local gMaps = {}
local bindings = require('bindings')
local utilities = require('utilities')
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
gMaps.command = 'location <query>'

View File

@ -3,7 +3,7 @@ local gSearch = {}
local HTTPS = require('ssl.https')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
gSearch.command = 'google <query>'

View File

@ -4,7 +4,7 @@
local greetings = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function greetings:init(config)
config.greetings = config.greetings or {

View File

@ -2,8 +2,8 @@ local hackernews = {}
local HTTPS = require('ssl.https')
local JSON = require('dkjson')
local bindings = require('bindings')
local utilities = require('utilities')
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
hackernews.command = 'hackernews'

View File

@ -4,7 +4,7 @@ local hearthstone = {}
--local HTTPS = require('ssl.https')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function hearthstone:init(config)
if not self.database.hearthstone or os.time() > self.database.hearthstone.expiration then

View File

@ -3,7 +3,7 @@
local help = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
local help_text

View File

@ -3,7 +3,7 @@ local imdb = {}
local HTTP = require('socket.http')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
imdb.command = 'imdb <query>'

View File

@ -6,7 +6,7 @@ local lastfm = {}
local HTTP = require('socket.http')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function lastfm:init(config)
if not config.lastfm_api_key then

View File

@ -1,6 +1,6 @@
local luarun = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
local URL = require('socket.url')
local JSON = require('dkjson')
@ -25,9 +25,9 @@ function luarun:action(msg, config)
end
local output = loadstring( [[
local bot = require('bot')
local bindings = require('bindings')
local utilities = require('utilities')
local bot = require('otouto.bot')
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
local JSON = require('dkjson')
local URL = require('socket.url')
local HTTP = require('socket.http')

View File

@ -1,6 +1,6 @@
local me = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function me:init(config)
me.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('me', true).table

View File

@ -1,6 +1,6 @@
local nick = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
nick.command = 'nick <nickname>'

View File

@ -1,6 +1,6 @@
local patterns = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
patterns.triggers = {
'^/?s/.-/.-$'

View File

@ -2,7 +2,7 @@
local ping = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function ping:init(config)
ping.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('ping'):t('annyong').table

View File

@ -2,8 +2,8 @@ local pokedex = {}
local HTTP = require('socket.http')
local JSON = require('dkjson')
local bindings = require('bindings')
local utilities = require('utilities')
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
pokedex.command = 'pokedex <query>'

View File

@ -1,7 +1,7 @@
local preview = {}
local HTTP = require('socket.http')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
preview.command = 'preview <link>'

View File

@ -1,6 +1,6 @@
local pun = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
pun.command = 'pun'
pun.doc = '`Returns a pun.`'

View File

@ -8,7 +8,7 @@
local reactions = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
reactions.command = 'reactions'
reactions.doc = '`Returns a list of "reaction" emoticon commands.`'

View File

@ -3,7 +3,7 @@ local reddit = {}
local HTTP = require('socket.http')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
reddit.command = 'reddit [r/subreddit | query]'

View File

@ -1,6 +1,6 @@
local remind = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
remind.command = 'remind <duration> <message>'

View File

@ -1,6 +1,6 @@
local setandget = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function setandget:init(config)
self.database.setandget = self.database.setandget or {}

View File

@ -1,6 +1,6 @@
local shell = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function shell:init(config)
shell.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('run', true).table

View File

@ -1,6 +1,6 @@
local shout = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
shout.command = 'shout <text>'

View File

@ -1,6 +1,6 @@
local slap = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
slap.command = 'slap [target]'

View File

@ -2,7 +2,7 @@ local time = {}
local HTTPS = require('ssl.https')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
time.command = 'time <location>'

View File

@ -3,7 +3,7 @@ local translate = {}
local HTTPS = require('ssl.https')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
translate.command = 'translate [text]'

View File

@ -3,7 +3,7 @@ local urbandictionary = {}
local HTTP = require('socket.http')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
urbandictionary.command = 'urbandictionary <query>'

View File

@ -2,7 +2,7 @@ local weather = {}
local HTTP = require('socket.http')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function weather:init(config)
if not config.owm_api_key then

View File

@ -1,6 +1,6 @@
local whoami = {}
local utilities = require('utilities')
local utilities = require('otouto.utilities')
whoami.command = 'whoami'

View File

@ -3,7 +3,7 @@ local wikipedia = {}
local HTTPS = require('ssl.https')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
wikipedia.command = 'wikipedia <query>'

View File

@ -2,7 +2,7 @@ local xkcd = {}
local HTTP = require('socket.http')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
xkcd.command = 'xkcd [i]'

View File

@ -5,7 +5,7 @@ local youtube = {}
local HTTPS = require('ssl.https')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('utilities')
local utilities = require('otouto.utilities')
function youtube:init(config)
if not config.google_api_key then

View File

@ -8,7 +8,7 @@ local ltn12 = require('ltn12')
local HTTPS = require('ssl.https')
local URL = require('socket.url')
local JSON = require('dkjson')
local bindings = require('bindings')
local bindings = require('otouto.bindings')
-- For the sake of ease to new contributors and familiarity to old contributors,
-- we'll provide a couple of aliases to real bindings here.