make brayden's stuff work
This commit is contained in:
parent
a97457aa01
commit
6fc5320198
@ -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
|
||||
|
@ -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.`'
|
||||
|
@ -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 = {}
|
||||
|
||||
|
@ -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]'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
local bandersnatch = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
bandersnatch.command = 'bandersnatch'
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 = [[```
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
local blacklist = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
function blacklist:init()
|
||||
if not self.database.blacklist then
|
||||
|
@ -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>'
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 = [[```
|
||||
|
@ -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
|
||||
|
@ -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.`'
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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>'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
local dice = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
dice.command = 'roll <nDr>'
|
||||
|
||||
|
@ -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]'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
local echo = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
echo.command = 'echo <text>'
|
||||
|
||||
|
@ -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!`'
|
||||
|
@ -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')
|
||||
|
@ -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
|
||||
|
@ -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>'
|
||||
|
||||
|
@ -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>'
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
local greetings = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
function greetings:init(config)
|
||||
config.greetings = config.greetings or {
|
||||
|
@ -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'
|
||||
|
||||
|
@ -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
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
local help = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
local help_text
|
||||
|
||||
|
@ -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>'
|
||||
|
||||
|
@ -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
|
||||
|
@ -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')
|
||||
|
@ -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
|
||||
|
@ -1,6 +1,6 @@
|
||||
local nick = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
nick.command = 'nick <nickname>'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
local patterns = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
patterns.triggers = {
|
||||
'^/?s/.-/.-$'
|
||||
|
@ -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
|
||||
|
@ -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>'
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
local preview = {}
|
||||
|
||||
local HTTP = require('socket.http')
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
preview.command = 'preview <link>'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
local pun = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
pun.command = 'pun'
|
||||
pun.doc = '`Returns a pun.`'
|
||||
|
@ -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.`'
|
||||
|
@ -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]'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
local remind = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
remind.command = 'remind <duration> <message>'
|
||||
|
||||
|
@ -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 {}
|
||||
|
@ -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
|
||||
|
@ -1,6 +1,6 @@
|
||||
local shout = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
shout.command = 'shout <text>'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
local slap = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
slap.command = 'slap [target]'
|
||||
|
||||
|
@ -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>'
|
||||
|
||||
|
@ -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]'
|
||||
|
||||
|
@ -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>'
|
||||
|
||||
|
@ -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
|
||||
|
@ -1,6 +1,6 @@
|
||||
local whoami = {}
|
||||
|
||||
local utilities = require('utilities')
|
||||
local utilities = require('otouto.utilities')
|
||||
|
||||
whoami.command = 'whoami'
|
||||
|
||||
|
@ -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>'
|
||||
|
||||
|
@ -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]'
|
||||
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
Reference in New Issue
Block a user