Final(?) fixes.

This commit is contained in:
Brayden Banks 2016-04-11 20:55:46 -07:00
parent 0e8a2693fb
commit fbe933f5ec
11 changed files with 17 additions and 17 deletions

View File

@ -1132,7 +1132,7 @@ function administration:action(msg)
end
function administration:cron()
self.temp.flood = {}
self.admin_temp.flood = {}
end
administration.command = 'groups'

View File

@ -4,18 +4,18 @@ local HTTP = require('socket.http')
local bindings = require('bindings')
local utilities = require('utilities')
function bindings:init()
function cats:init()
if not self.config.thecatapi_key then
print('Missing config value: thecatapi_key.')
print('cats.lua will be enabled, but there are more features with a key.')
end
cats.triggers = utilities.triggers(self.info.username):t('cat').table
end
cats.command = 'cat'
cats.doc = '`Returns a cat!`'
cats.triggers = utilities.triggers():t('cat').table
function cats:action(msg)
local url = 'http://thecatapi.com/api/images/get?format=html&type=jpg'

View File

@ -17,7 +17,7 @@ function dice:action(msg)
local input = utilities.input(msg.text_lower)
if not input then
bindings.sendMessage(msg.chat.id, dice.doc, true, msg.message_id, true)
bindings.sendMessage(self, msg.chat.id, dice.doc, true, msg.message_id, true)
return
end

View File

@ -19,7 +19,7 @@ end
function dilbert:action(msg)
bindings.sendChatAction(msg.chat.id, 'upload_photo')
bindings.sendChatAction(self, msg.chat.id, 'upload_photo')
local input = utilities.input(msg.text)
if not input then input = os.date('%F') end

View File

@ -7,7 +7,7 @@ local JSON = require('cjson')
local utilities = require('utilities')
function floodcontrol:init()
self.floodcontrol = floodcontrol or {}
self.floodcontrol = self.floodcontrol or {}
end
floodcontrol.triggers = {

View File

@ -1,5 +1,5 @@
-- You need a Google API key and a Google Custom Search Engine set up to use this, in config.google_api_key and config.google_cse_key, respectively.
-- You must also sign up for the CSE in the Google Developer Concsole, and enable image results.
-- You must also sign up for the CSE in the Google Developer Console, and enable image results.
local gImages = {}
@ -20,7 +20,7 @@ function gImages:init()
return
end
gImages.triggers = utilities.triggers():t('image', true):t('i', true):t('insfw', true).table
gImages.triggers = utilities.triggers(self.info.username):t('image', true):t('i', true):t('insfw', true).table
end
gImages.command = 'image <query>'

View File

@ -11,7 +11,9 @@ Returns four (if group) or eight (if private message) top stories from Hacker Ne
Alias: /hn
```]]
hackernews.triggers = utilities.triggers():t('hackernews', true):t('hn', true).table
function hackernews:init()
hackernews.triggers = utilities.triggers(self.info.username):t('hackernews', true):t('hn', true).table
end
function hackernews:action(msg)

View File

@ -15,7 +15,7 @@ function help:init()
end
end
help.triggers = utilities.triggers():t('help', true):t('h', true).table
help.triggers = utilities.triggers(self.info.username):t('help', true):t('h', true).table
end
help_text = help_text .. [[

View File

@ -62,7 +62,7 @@ function pokedex:action(msg)
local output = '*' .. dex_jdat.name .. '*\n#' .. dex_jdat.national_id .. ' | ' .. poke_type .. '\n_' .. desc_jdat.description:gsub('POKMON', 'Pokémon'):gsub('Pokmon', 'Pokémon') .. '_'
bindings.sendMessage(msg.chat.id, output, true, nil, true)
bindings.sendMessage(self, msg.chat.id, output, true, nil, true)
end

View File

@ -10,7 +10,7 @@ Shouts something.
```]]
function shout:init()
shout.triggers = utilities.triggers(self.info.username):t('shout', true)
shout.triggers = utilities.triggers(self.info.username):t('shout', true).table
end
function shout:action(msg)

View File

@ -14,6 +14,8 @@ function youtube:init()
print('youtube.lua will not be enabled.')
return
end
youtube.triggers = utilities.triggers(self.info.username):t('youtube', true):t('yt', true).table
end
youtube.command = 'youtube <query>'
@ -23,10 +25,6 @@ Returns the top result from YouTube.
Alias: /yt
```]]
function youtube:init()
youtube.triggers = utilities.triggers(self.info.username):t('youtube', true):t('yt', true).table
end
function youtube:action(msg)
local input = utilities.input(msg.text)