Final(?) fixes.
This commit is contained in:
		| @@ -1132,7 +1132,7 @@ function administration:action(msg) | |||||||
| end | end | ||||||
|  |  | ||||||
| function administration:cron() | function administration:cron() | ||||||
| 	self.temp.flood = {} | 	self.admin_temp.flood = {} | ||||||
| end | end | ||||||
|  |  | ||||||
| administration.command = 'groups' | administration.command = 'groups' | ||||||
|   | |||||||
| @@ -4,18 +4,18 @@ local HTTP = require('socket.http') | |||||||
| local bindings = require('bindings') | local bindings = require('bindings') | ||||||
| local utilities = require('utilities') | local utilities = require('utilities') | ||||||
|  |  | ||||||
| function bindings:init() | function cats:init() | ||||||
| 	if not self.config.thecatapi_key then | 	if not self.config.thecatapi_key then | ||||||
| 		print('Missing config value: thecatapi_key.') | 		print('Missing config value: thecatapi_key.') | ||||||
| 		print('cats.lua will be enabled, but there are more features with a key.') | 		print('cats.lua will be enabled, but there are more features with a key.') | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
|  | 	cats.triggers = utilities.triggers(self.info.username):t('cat').table | ||||||
| end | end | ||||||
|  |  | ||||||
| cats.command = 'cat' | cats.command = 'cat' | ||||||
| cats.doc = '`Returns a cat!`' | cats.doc = '`Returns a cat!`' | ||||||
|  |  | ||||||
| cats.triggers = utilities.triggers():t('cat').table |  | ||||||
|  |  | ||||||
| function cats:action(msg) | function cats:action(msg) | ||||||
|  |  | ||||||
| 	local url = 'http://thecatapi.com/api/images/get?format=html&type=jpg' | 	local url = 'http://thecatapi.com/api/images/get?format=html&type=jpg' | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ function dice:action(msg) | |||||||
|  |  | ||||||
| 	local input = utilities.input(msg.text_lower) | 	local input = utilities.input(msg.text_lower) | ||||||
| 	if not input then | 	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 | 		return | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ end | |||||||
|  |  | ||||||
| function dilbert:action(msg) | 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) | 	local input = utilities.input(msg.text) | ||||||
| 	if not input then input = os.date('%F') end | 	if not input then input = os.date('%F') end | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ local JSON = require('cjson') | |||||||
| local utilities = require('utilities') | local utilities = require('utilities') | ||||||
|  |  | ||||||
| function floodcontrol:init() | function floodcontrol:init() | ||||||
| 	self.floodcontrol = floodcontrol or {} | 	self.floodcontrol = self.floodcontrol or {} | ||||||
| end | end | ||||||
|  |  | ||||||
| floodcontrol.triggers = { | floodcontrol.triggers = { | ||||||
|   | |||||||
| @@ -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 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 = {} | local gImages = {} | ||||||
|  |  | ||||||
| @@ -20,7 +20,7 @@ function gImages:init() | |||||||
| 		return | 		return | ||||||
| 	end | 	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 | end | ||||||
|  |  | ||||||
| gImages.command = 'image <query>' | gImages.command = 'image <query>' | ||||||
|   | |||||||
| @@ -11,7 +11,9 @@ Returns four (if group) or eight (if private message) top stories from Hacker Ne | |||||||
| Alias: /hn | 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) | function hackernews:action(msg) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -15,7 +15,7 @@ function help:init() | |||||||
| 		end | 		end | ||||||
| 	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 | end | ||||||
|  |  | ||||||
| help_text = help_text .. [[ | help_text = help_text .. [[ | ||||||
|   | |||||||
| @@ -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') .. '_' | 	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 | end | ||||||
|  |  | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ Shouts something. | |||||||
| ```]] | ```]] | ||||||
|  |  | ||||||
| function shout:init() | 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 | end | ||||||
|  |  | ||||||
| function shout:action(msg) | function shout:action(msg) | ||||||
|   | |||||||
| @@ -14,6 +14,8 @@ function youtube:init() | |||||||
| 		print('youtube.lua will not be enabled.') | 		print('youtube.lua will not be enabled.') | ||||||
| 		return | 		return | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
|  | 	youtube.triggers = utilities.triggers(self.info.username):t('youtube', true):t('yt', true).table | ||||||
| end | end | ||||||
|  |  | ||||||
| youtube.command = 'youtube <query>' | youtube.command = 'youtube <query>' | ||||||
| @@ -23,10 +25,6 @@ Returns the top result from YouTube. | |||||||
| Alias: /yt | Alias: /yt | ||||||
| ```]] | ```]] | ||||||
|  |  | ||||||
| function youtube:init() |  | ||||||
| 	youtube.triggers = utilities.triggers(self.info.username):t('youtube', true):t('yt', true).table |  | ||||||
| end |  | ||||||
|  |  | ||||||
| function youtube:action(msg) | function youtube:action(msg) | ||||||
|  |  | ||||||
| 	local input = utilities.input(msg.text) | 	local input = utilities.input(msg.text) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Brayden Banks
					Brayden Banks