From 9377107508cbfefc99daaff270c9286d30387076 Mon Sep 17 00:00:00 2001 From: topkecleon Date: Sat, 26 Mar 2016 06:12:01 -0400 Subject: [PATCH] Bugfixes and updated readme. --- README.md | 41 +++++++++++++++++++------------------- plugins/administration.lua | 4 +--- plugins/blacklist.lua | 5 +++++ plugins/hearthstone.lua | 2 +- plugins/me.lua | 4 ---- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 1b7d60a..9f8d3ff 100755 --- a/README.md +++ b/README.md @@ -175,42 +175,43 @@ Once this is set up, put your bot in the admin group and run `/modadd` and `/mod | Plugin | Command | Function | Aliases | |:-------|:--------|:---------|:--------| -| help.lua | /help | Returns a list of commands. | /h | +| help.lua | /help [command] | Returns a list of commands or command-specific help. | /h | | about.lua | /about | Returns the about text as configured in config.lua. | | ping.lua | /ping | The simplest plugin ever! | -| echo.lua | /echo | Repeats a string of text. | -| gSearch.lua | /google | Returns Google web results. | /g, /gnsfw | -| gImages.lua | /images | Returns a Google image result. | /i, /insfw | -| gMaps.lua | /location | Returns location data from Google Maps. | /loc | -| youtube.lua | /youtube | Returns the top video result from YouTube. | /yt | -| wikipedia.lua | /wikipedia | Returns the summary of a Wikipedia article. | /wiki | +| echo.lua | /echo <text> | Repeats a string of text. | +| gSearch.lua | /google <query> | Returns Google web results. | /g, /gnsfw | +| gImages.lua | /images <query> | Returns a Google image result. | /i, /insfw | +| gMaps.lua | /location <query> | Returns location data from Google Maps. | /loc | +| youtube.lua | /youtube <query> | Returns the top video result from YouTube. | /yt | +| wikipedia.lua | /wikipedia <query> | Returns the summary of a Wikipedia article. | /wiki | | lastfm.lua | /np [username] | Returns the song you are currently listening to. | | lastfm.lua | /fmset [username] | Sets your username for /np. /fmset -- will delete it. | | hackernews.lua | /hackernews | Returns the latest posts from Hacker News. | /hn | -| imdb.lua | /imdb | Returns film information from IMDb. | -| hearthstone.lua | /hearthstone | Returns data for Hearthstone cards matching the query. | /hs | -| calc.lua | /calc | Returns solutions to math expressions and conversions between common units. | -| bible.lua | /bible | Returns a Bible verse. | /b | -| urbandictionary.lua | /urbandictionary | Returns the top definition from Urban Dictionary. | /ud, /urban | -| time.lua | /time | Returns the time, date, and a timezone for a location. | -| weather.lua | /weather | Returns current weather conditions for a given location. | -| nick.lua | /nick | Set your nickname. /nick - will delete it. | +| imdb.lua | /imdb <query> | Returns film information from IMDb. | +| hearthstone.lua | /hearthstone <query> | Returns data for Hearthstone cards matching the query. | /hs | +| calc.lua | /calc <expression> | Returns solutions to math expressions and conversions between common units. | +| bible.lua | /bible <reference> | Returns a Bible verse. | /b | +| urbandictionary.lua | /urbandictionary <query> | Returns the top definition from Urban Dictionary. | /ud, /urban | +| time.lua | /time <query> | Returns the time, date, and a timezone for a location. | +| weather.lua | /weather <query> | Returns current weather conditions for a given location. | +| nick.lua | /nick <nickname> | Set your nickname. /nick - will delete it. | | whoami.lua | /whoami | Returns user and chat info for you or the replied-to user. | /who | | eightball.lua | /8ball | Returns an answer from a magic 8-ball. | -| dice.lua | /roll | Returns RNG dice rolls. Uses D&D notation. | +| dice.lua | /roll <nDr> | Returns RNG dice rolls. Uses D&D notation. | | reddit.lua | /reddit [r/subreddit ¦ query] | Returns the top results from a given subreddit, query, or r/all. | /r | | xkcd.lua | /xkcd [query] | Returns an xkcd strip and its alt text. | -| slap.lua | /slap | Gives someone a slap (or worse). | +| slap.lua | /slap <target> | Gives someone a slap (or worse). | | commit.lua | /commit | Returns a commit message from whatthecommit.com. | | fortune.lua | /fortune | Returns a UNIX fortune. | | pun.lua | /pun | Returns a pun. | -| pokedex.lua | /pokedex | Returns a Pokedex entry. | /dex | -| currency.lua | /cash [amount] to | Converts one currency to another. | +| pokedex.lua | /pokedex <query> | Returns a Pokedex entry. | /dex | +| currency.lua | /cash [amount] <currency> to <currency> | Converts one currency to another. | | cats.lua | /cat | Returns a cat picture. | | reactions.lua | /reactions | Returns a list of reaction emoticons which can be used through the bot. | | apod.lua | /apod [date] | Returns the NASA Astronomy Picture of the Day. | | dilbert.lua | /dilbert [date] | Returns a Dilbert strip. | -| patterns.lua | /s/// | Fixed that for you. :^) | +| patterns.lua | /s/<from>/<to>/ | Fixed that for you. :^) | +| me.lua | /me | Returns user-specific data stored by the bot. | * * * diff --git a/plugins/administration.lua b/plugins/administration.lua index 2a08b85..0b7ae9b 100644 --- a/plugins/administration.lua +++ b/plugins/administration.lua @@ -998,9 +998,7 @@ local commands = { end input = '*Admin Broadcast:*\n' .. input for k,v in pairs(database.administration.groups) do - if tonumber(k) then - sendMessage(k, input, true, nil, true) - end + sendMessage(k, input, true, nil, true) end end } diff --git a/plugins/blacklist.lua b/plugins/blacklist.lua index df14993..9af0ed5 100755 --- a/plugins/blacklist.lua +++ b/plugins/blacklist.lua @@ -12,6 +12,7 @@ local triggers = { local action = function(msg) if database.blacklist[msg.from.id_str] then return end + if database.blacklist[msg.chat.id_str] then return end if not msg.text:match('^/blacklist') then return true end if msg.from.id ~= config.admin then return end @@ -21,6 +22,10 @@ local triggers = { return end + if tonumber(target.id) < 0 then + target.name = 'Group' + end + if database.blacklist[tostring(target.id)] then database.blacklist[tostring(target.id)] = nil sendReply(msg, target.name .. ' has been removed from the blacklist.') diff --git a/plugins/hearthstone.lua b/plugins/hearthstone.lua index 1349950..8d18b9a 100755 --- a/plugins/hearthstone.lua +++ b/plugins/hearthstone.lua @@ -30,7 +30,7 @@ local command = 'hearthstone ' local doc = [[``` /hearthstone Returns Hearthstone card info. -Alias: /hn +Alias: /hs ```]] local triggers = { diff --git a/plugins/me.lua b/plugins/me.lua index 6e3eac3..e821fdb 100644 --- a/plugins/me.lua +++ b/plugins/me.lua @@ -19,10 +19,6 @@ local action = function(msg) for k,v in pairs(target) do output = output .. '*' .. k .. ':* `' .. v .. '`\n' end - output = output .. '\n' - for k,v in pairs(msg.chat) do - output = output .. '*' .. k .. ':* `' .. v .. '`\n' - end sendMessage(msg.chat.id, output, true, nil, true) end