Skip to content

Commit

Permalink
modules: use "use" function
Browse files Browse the repository at this point in the history
  • Loading branch information
Xe committed Jan 3, 2015
1 parent 804a515 commit 9f3c937
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/chatbot/bitly.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-- Shortens long URL's with bit.ly
-- Needs a bit.ly api key

use "strings"

function scrapeurl(str)
return str:match("https?://[%w-_%.%?%.:/%+=&]+")
end
Expand Down
2 changes: 2 additions & 0 deletions modules/chatbot/core/fantasy.moon
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use "strings"

Hook "CHATBOT-CHANMSG", (source, dest, msg) ->
command = strings.rest(msg[1])\upper!
prefix = strings.first(msg[1])
Expand Down
2 changes: 2 additions & 0 deletions modules/chatbot/derpibooru.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
local json = require "json"

use "strings"

function dblookup(id)
local url = "http://derpiboo.ru/"..id..".json?nocomments"

Expand Down
2 changes: 2 additions & 0 deletions modules/chatbot/eval.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ld = nil

use "strings"

Hook("CHATBOT-CHANMSG", function(source, destination, message)
if not source.IsOper() then
return
Expand Down
2 changes: 2 additions & 0 deletions modules/chatbot/sendfile.moon
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use "strings"

Command "SENDFILE", true, (source, dest, message) ->
if #message < 2
return "Need a destination and file to send."
Expand Down
2 changes: 2 additions & 0 deletions modules/mongblocker/spamscan.moon
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require "lib/bayes"

use "strings"

export ^

Scores = {}
Expand Down
2 changes: 2 additions & 0 deletions modules/tetra/connlog.moon
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
sqlite3 = require "lsqlite3"

use "strings"

export db = sqlite3.open "var/tetra.db"
export done = false

Expand Down
2 changes: 2 additions & 0 deletions modules/tetra/core/autoupgrade.moon
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use "strings"

-- Takes in a string and outputs a trimmed string
trim = (str) ->
str\gsub "^%s*(.-)%s*$", "%1"
Expand Down
2 changes: 2 additions & 0 deletions modules/tetra/core/encap.moon
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use "strings"

-- :6YK ENCAP * METADATA SET 7RT100001 CLOAKEDHOST :yolo-swag.com
Hook "ENCAP-METADATA", (source, args) ->
action = args[1]
Expand Down
2 changes: 2 additions & 0 deletions modules/tetra/core/hostserv.moon
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use "strings"

Hook "HOSTSERV-SERVICELOG", (message) ->
-- (@HostServ) Xena REQUEST: ninjas
tetra.RunHook "HOSTSERV-REQUEST", message[1], strings.shuck(message[3])
2 changes: 2 additions & 0 deletions modules/tetra/hostservpolicy.moon
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require "lib/etcd"

use "strings"

-- Allow policy for vhosts to be automatically rejected or activated
--
-- table for each vhost will look like:
Expand Down
2 changes: 2 additions & 0 deletions modules/tetra/killonfailoper.moon
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use "strings"

Hook "ENCAP-SNOTE-S", (message) ->
if not message\match "host mismatch"
return
Expand Down
3 changes: 3 additions & 0 deletions modules/zuul/anontor.moon
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
use "crypto"
use "strings"

Hash = (foo) ->
crypto.fnv(foo)

Expand Down

0 comments on commit 9f3c937

Please sign in to comment.