From af3da2abfd855585a4841c203b88f55e42bb6d93 Mon Sep 17 00:00:00 2001 From: dupie Date: Wed, 8 Jul 2015 03:38:04 -0400 Subject: [PATCH] swapped ! for / --- README.md | 1 + plugins/8ball.lua | 6 +++--- plugins/admin.lua | 2 +- plugins/bandersnatch.lua | 6 +++--- plugins/bible.lua | 6 +++--- plugins/btc.lua | 4 ++-- plugins/calc.lua | 4 ++-- plugins/commit.lua | 4 ++-- plugins/dice.lua | 4 ++-- plugins/dogify.lua | 6 +++--- plugins/echo.lua | 4 ++-- plugins/fortune.lua | 6 +++--- plugins/gImages.lua | 12 ++++++------ plugins/gMaps.lua | 4 ++-- plugins/gSearch.lua | 10 +++++----- plugins/giphy.lua | 8 ++++---- plugins/hackernews.lua | 6 +++--- plugins/help.lua | 6 +++--- plugins/hex.lua | 4 ++-- plugins/imdb.lua | 4 ++-- plugins/pokedex.lua | 4 ++-- plugins/pun.lua | 4 ++-- plugins/reddit.lua | 8 ++++---- plugins/remind.lua | 6 +++--- plugins/shrug.lua | 1 - plugins/slap.lua | 4 ++-- plugins/time.lua | 4 ++-- plugins/urbandictionary.lua | 6 +++--- plugins/weather.lua | 4 ++-- plugins/whoami.lua | 13 ++++++------- plugins/xkcd.lua | 4 ++-- 31 files changed, 82 insertions(+), 83 deletions(-) diff --git a/README.md b/README.md index 7d4b7ec..69fbc65 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,5 @@ TIME_OFFSET is the time difference, in seconds, between your system clock. It is "people" table is for the personality plugin: `"123456789": "foobar"` + ID number must be a string. diff --git a/plugins/8ball.lua b/plugins/8ball.lua index 2594372..eaf20bc 100644 --- a/plugins/8ball.lua +++ b/plugins/8ball.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !8ball + /8ball Magic 8-ball. Returns a standard 8ball message, unless called with "y/n", where it will return a less verbose answer. ]] PLUGIN.triggers = { - '^!helix', - '^!8ball', + '^/helix', + '^/8ball', 'y/n%p?$' } diff --git a/plugins/admin.lua b/plugins/admin.lua index 7cbc2b4..deca5f3 100644 --- a/plugins/admin.lua +++ b/plugins/admin.lua @@ -1,7 +1,7 @@ local PLUGIN = {} PLUGIN.triggers = { - '^!admin ' + '^/admin ' } function PLUGIN.action(msg) diff --git a/plugins/bandersnatch.lua b/plugins/bandersnatch.lua index 3fcc17d..09946fd 100644 --- a/plugins/bandersnatch.lua +++ b/plugins/bandersnatch.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !bandersnatch + /bandersnatch This is a Benedict Cumberbatch name generator. ]] PLUGIN.triggers = { - '^!bandersnatch', - '^!bc$' + '^/bandersnatch', + '^/bc$' } PLUGIN.fullnames = { "Wimbledon Tennismatch", "Rinkydink Curdlesnoot", "Butawhiteboy Cantbekhan", "Benadryl Claritin", "Bombadil Rivendell", "Wanda's Crotchfruit", "Biblical Concubine", "Syphilis Cankersore", "Buckminster Fullerene", "Bourgeoisie Capitalist" } diff --git a/plugins/bible.lua b/plugins/bible.lua index 24afc5d..7a735ef 100644 --- a/plugins/bible.lua +++ b/plugins/bible.lua @@ -1,14 +1,14 @@ local PLUGIN = {} PLUGIN.doc = [[ - !bible + /bible Returns a verse from the bible, King James Version. Use a standard or abbreviated reference (John 3:16, Jn3:16). http://biblia.com ]] PLUGIN.triggers = { - '^!bible', - '^!b ' + '^/bible', + '^/b ' } function PLUGIN.action(msg) diff --git a/plugins/btc.lua b/plugins/btc.lua index 233c134..c75ce27 100644 --- a/plugins/btc.lua +++ b/plugins/btc.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !btc [amount] + /btc [amount] Gives bitcoin prices for the given currency, and optionally conversion of an amount to and from that currency. BitcoinAverage Price Index https://bitcoinaverage.com/ ]] PLUGIN.triggers = { - '^!btc' + '^/btc' } function PLUGIN.action(msg) diff --git a/plugins/calc.lua b/plugins/calc.lua index 4b7d7c0..77de397 100644 --- a/plugins/calc.lua +++ b/plugins/calc.lua @@ -1,12 +1,12 @@ local PLUGIN = {} PLUGIN.doc = [[ - !calc + /calc This command solves math expressions and does conversion between common units. See mathjs.org/docs/expressions/syntax for a list of accepted syntax. ]] PLUGIN.triggers = { - '^!calc' + '^/calc' } function PLUGIN.action(msg) diff --git a/plugins/commit.lua b/plugins/commit.lua index 7a827ad..f7ee22c 100644 --- a/plugins/commit.lua +++ b/plugins/commit.lua @@ -1,12 +1,12 @@ local PLUGIN = {} PLUGIN.doc = [[ - !commit + /commit http://whatthecommit.com. ]] PLUGIN.triggers = { - '^!commit' + '^/commit' } function PLUGIN.action(msg) diff --git a/plugins/dice.lua b/plugins/dice.lua index d1b313d..b953a39 100644 --- a/plugins/dice.lua +++ b/plugins/dice.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !roll [range] + /roll [range] Roll a die. Use any positive number for range or use D&D notation. Example: !roll 4D100 will roll a 100-sided die four times. ]] PLUGIN.triggers = { - '^!roll' + '^/roll' } function PLUGIN.action(msg) diff --git a/plugins/dogify.lua b/plugins/dogify.lua index 11c7704..e95535f 100644 --- a/plugins/dogify.lua +++ b/plugins/dogify.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !dogify + /dogify Produces a doge image from dogr.io. Newlines are indicated by a forward slash. Words do not need to be spaced, but spacing is supported. Will post a previewed link rather than an image. ]] PLUGIN.triggers = { - '^!doge ', - '^!dogify ' + '^/doge ', + '^/dogify ' } function PLUGIN.action(msg) diff --git a/plugins/echo.lua b/plugins/echo.lua index 4bec525..c85b065 100644 --- a/plugins/echo.lua +++ b/plugins/echo.lua @@ -1,12 +1,12 @@ local PLUGIN = {} PLUGIN.doc = [[ - !echo + /echo Repeat a string. ]] PLUGIN.triggers = { - '^!echo' + '^/echo' } function PLUGIN.action(msg) diff --git a/plugins/fortune.lua b/plugins/fortune.lua index 99f2712..2aeed62 100644 --- a/plugins/fortune.lua +++ b/plugins/fortune.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !fortune + /fortune Get a random fortune from the UNIX fortune program. ]] PLUGIN.triggers = { - '^!fortune', - '^!f$' + '^/fortune', + '^/f$' } function PLUGIN.action(msg) diff --git a/plugins/gImages.lua b/plugins/gImages.lua index c3a8764..05591ab 100644 --- a/plugins/gImages.lua +++ b/plugins/gImages.lua @@ -1,15 +1,15 @@ local PLUGIN = {} PLUGIN.doc = [[ - !images + /images This command performs a Google Images search for the given query. One random top result is returned. Safe search is enabled by default; use '!insfw' to get potentially NSFW results. ]] PLUGIN.triggers = { - '^!images?', - '^!img', - '^!i ', - '^!insfw' + '^/images?', + '^/img', + '^/i ', + '^/insfw' } PLUGIN.exts = { @@ -24,7 +24,7 @@ function PLUGIN.action(msg) local url = 'http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8' - if not string.match(msg.text, '^!insfw ') then + if not string.match(msg.text, '^/insfw ') then url = url .. '&safe=active' end diff --git a/plugins/gMaps.lua b/plugins/gMaps.lua index 9dfa2ab..ce76f70 100644 --- a/plugins/gMaps.lua +++ b/plugins/gMaps.lua @@ -1,12 +1,12 @@ local PLUGIN = {} PLUGIN.doc = [[ - !loc + /loc Sends location data for query, taken from Google Maps. Works for countries, cities, landmarks, etc. ]] PLUGIN.triggers = { - '^!loc' + '^/loc' } function PLUGIN.action(msg) diff --git a/plugins/gSearch.lua b/plugins/gSearch.lua index c22b24a..6336e11 100644 --- a/plugins/gSearch.lua +++ b/plugins/gSearch.lua @@ -1,21 +1,21 @@ local PLUGIN = {} PLUGIN.doc = [[ - !google + /google This command performs a Google search for the given query. Four results are returned. Safe search is enabled by default; use '!gnsfw' to get potentially NSFW results. Four results are returned for a group chat, or eight in a private message. ]] PLUGIN.triggers = { - '^!g ', - '^!google', - '^!gnsfw' + '^/g ', + '^/google', + '^/gnsfw' } function PLUGIN.action(msg) local url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0' - if not string.match(msg.text, '^!gnsfw ') then + if not string.match(msg.text, '^/gnsfw ') then url = url .. '&safe=active' end diff --git a/plugins/giphy.lua b/plugins/giphy.lua index 67d303a..b1cfff4 100644 --- a/plugins/giphy.lua +++ b/plugins/giphy.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !giphy [query] + /giphy [query] Returns a random or search-resulted GIF from giphy.com. Results are limited to PG-13 by default; use '!gifnsfw' to get potentially NSFW results. ]] PLUGIN.triggers = { - '^!giphy', - '^!gifnsfw' + '^/giphy', + '^/gifnsfw' } function PLUGIN.action(msg) @@ -16,7 +16,7 @@ function PLUGIN.action(msg) local random_url = 'http://tv.giphy.com/v1/gifs/random?api_key=' .. config.GIPHY_API_KEY local result_url = '' - if string.match(msg.text, '^!giphynsfw') then + if string.match(msg.text, '^/giphynsfw') then search_url = search_url .. '&rating=r&q=' random_url = random_url .. '&rating=r' else diff --git a/plugins/hackernews.lua b/plugins/hackernews.lua index 0b30a95..c13fa60 100644 --- a/plugins/hackernews.lua +++ b/plugins/hackernews.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !hackernews + /hackernews Returns some top stories from Hacker News. Four in a group or eight in a private message. ]] PLUGIN.triggers = { - '^!hackernews', - '^!hn$' + '^/hackernews', + '^/hn$' } function PLUGIN.action(msg) diff --git a/plugins/help.lua b/plugins/help.lua index 1c6e587..955201f 100644 --- a/plugins/help.lua +++ b/plugins/help.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !help [command] + /help [command] Get list of basic information for all commands, or more detailed documentation on a specified command. ]] PLUGIN.triggers = { - '^!help', - '^!h$', + '^/help', + '^/h$', '^/help' } diff --git a/plugins/hex.lua b/plugins/hex.lua index 955a4d2..50b2c84 100644 --- a/plugins/hex.lua +++ b/plugins/hex.lua @@ -1,12 +1,12 @@ local PLUGIN = {} PLUGIN.doc = [[ - !hex + /hex This function converts a number to or from hexadecimal. ]] PLUGIN.triggers = { - '^!hex ' + '^/hex ' } function PLUGIN.action(msg) diff --git a/plugins/imdb.lua b/plugins/imdb.lua index c0bf295..b1d726b 100644 --- a/plugins/imdb.lua +++ b/plugins/imdb.lua @@ -1,12 +1,12 @@ local PLUGIN = {} PLUGIN.doc = [[ - !imdb + /imdb This function retrieves the IMDb info for a given film or television series, including the year, genre, imdb rating, runtime, and a summation of the plot. ]] PLUGIN.triggers = { - '^!imdb' + '^/imdb' } function PLUGIN.action(msg) diff --git a/plugins/pokedex.lua b/plugins/pokedex.lua index 4557b6d..ebef794 100644 --- a/plugins/pokedex.lua +++ b/plugins/pokedex.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !dex + /dex Get Pokedex information for a given Pokemon. Includes national ID number, type, height, weight, and a description from a random regional dex. ]] PLUGIN.triggers = { - '^!dex' + '^/dex' } function PLUGIN.action(msg) diff --git a/plugins/pun.lua b/plugins/pun.lua index 70bcd6a..46d6c59 100644 --- a/plugins/pun.lua +++ b/plugins/pun.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !pun + /pun Get a random pun. Have a recommendation? PM @topkecleon. ]] PLUGIN.triggers = { - '^!pun' + '^/pun' } PLUGIN.puns = { diff --git a/plugins/reddit.lua b/plugins/reddit.lua index fd2d6f1..6704229 100644 --- a/plugins/reddit.lua +++ b/plugins/reddit.lua @@ -1,14 +1,14 @@ local PLUGIN = {} PLUGIN.doc = [[ - !reddit [r/subreddit | query] + /reddit [r/subreddit | query] This command returns top results for a given query or subreddit. NSFW posts are marked as such. ]] PLUGIN.triggers = { - '^!reddit', - '^!r$', - '^!r ' + '^/reddit', + '^/r$', + '^/r ' } function PLUGIN.action(msg) diff --git a/plugins/remind.lua b/plugins/remind.lua index f1d4498..b342672 100644 --- a/plugins/remind.lua +++ b/plugins/remind.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !remind + /remind Set a reminder for yourself. First argument is the number of minutes until you wish to be reminded. ]] PLUGIN.triggers = { - '^!remind$', - '^!remind ' + '^/remind$', + '^/remind ' } function PLUGIN.action(msg) diff --git a/plugins/shrug.lua b/plugins/shrug.lua index c47ed56..66d4705 100644 --- a/plugins/shrug.lua +++ b/plugins/shrug.lua @@ -1,7 +1,6 @@ local PLUGIN = {} PLUGIN.triggers = { - '^!shrug', '/shrug' } diff --git a/plugins/slap.lua b/plugins/slap.lua index 7938739..6585a93 100644 --- a/plugins/slap.lua +++ b/plugins/slap.lua @@ -1,12 +1,12 @@ local PLUGIN = {} PLUGIN.doc = [[ - !slap [victim] + /slap [victim] Slap someone! ]] PLUGIN.triggers = { - '^!slap' + '^/slap' } function PLUGIN.getSlap(slapper, victim) diff --git a/plugins/time.lua b/plugins/time.lua index 9c4a910..9348388 100644 --- a/plugins/time.lua +++ b/plugins/time.lua @@ -3,12 +3,12 @@ local PLUGIN = {} PLUGIN.doc = [[ - !time + /time Sends the time and timezone for a given location. ]] PLUGIN.triggers = { - '^!time' + '^/time' } function PLUGIN.action(msg) diff --git a/plugins/urbandictionary.lua b/plugins/urbandictionary.lua index d440daf..570e2df 100644 --- a/plugins/urbandictionary.lua +++ b/plugins/urbandictionary.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !ud + /ud Returns the first definition for a given term from Urban Dictionary. ]] PLUGIN.triggers = { - '^!ud', - '^!urbandictionary' + '^/ud', + '^/urbandictionary' } function PLUGIN.action(msg) diff --git a/plugins/weather.lua b/plugins/weather.lua index 1dd9890..bf9a075 100644 --- a/plugins/weather.lua +++ b/plugins/weather.lua @@ -1,13 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !weather + /weather Returns the current temperature and weather conditions for a specified location. Non-city locations are accepted; "!weather Buckingham Palace" will return the weather for Westminster. ]] PLUGIN.triggers = { - '^!weather' + '^/weather' } function PLUGIN.action(msg) diff --git a/plugins/whoami.lua b/plugins/whoami.lua index 010fdfd..b955078 100644 --- a/plugins/whoami.lua +++ b/plugins/whoami.lua @@ -1,14 +1,13 @@ local PLUGIN = {} PLUGIN.doc = [[ - !whoami + /whoami Get the user ID for yourself and the group. ]] PLUGIN.triggers = { - '^!whoami', - '^!ping', - '^/ping' + '^/whoami', + '^/ping', } function PLUGIN.action(msg) @@ -21,15 +20,15 @@ function PLUGIN.action(msg) from_name = '@' .. msg.from.username .. ', AKA ' .. from_name end from_name = from_name .. ' (' .. msg.from.id .. ')' - + if msg.from.id == msg.chat.id then to_name = '@' .. bot.username .. ' (' .. bot.id .. ')' else to_name = string.gsub(msg.chat.title, '_', ' ') .. ' (' .. string.gsub(msg.chat.id, '-', '') .. ')' end - + local message = 'You are ' .. from_name .. ' and you are messaging ' .. to_name .. '.' - + send_msg(msg, message) end diff --git a/plugins/xkcd.lua b/plugins/xkcd.lua index 445bdbd..1578489 100644 --- a/plugins/xkcd.lua +++ b/plugins/xkcd.lua @@ -1,12 +1,12 @@ local PLUGIN = {} PLUGIN.doc = [[ - !xkcd [search] + /xkcd [search] This command returns an xkcd strip, its number, and its "secret" text. You may search for a specific strip or get a random one. ]] PLUGIN.triggers = { - '^!xkcd' + '^/xkcd' } function PLUGIN.action(msg)