|
|
@@ -1,4 +1,3 @@ |
|
|
-ddg = require('ddg')
|
|
|
colors = require('irc-colors')
|
|
|
|
|
|
module.exports = (bot) ->
|
|
|
@@ -131,20 +130,6 @@ module.exports = (bot) -> |
|
|
]
|
|
|
r.reply bot.random vic
|
|
|
|
|
|
- bot.regexp /^\.d (.+)/,
|
|
|
- ".d -- Vse kar zna https://api.duckduckgo.com/api ali https://api.duckduckgo.com/goodies",
|
|
|
- (match, r) ->
|
|
|
- options =
|
|
|
- useragent: "ubuntu.si"
|
|
|
- no_redirects: "1"
|
|
|
- no_html: "1"
|
|
|
-
|
|
|
- ddg.query match[1].trim(), options, (err, data) ->
|
|
|
- r.reply data.AbstractText
|
|
|
- r.reply data.Definition
|
|
|
- r.reply data.Answer
|
|
|
- r.reply data.AbstractURL || data.Redirect
|
|
|
-
|
|
|
bot.regexp /^\.gif (.+)/, ".gif <query> -- Prikaže naključni gif", (match, r) ->
|
|
|
url = "http://giphy.com/search/#{encodeURI(match[1].replace(/[^a-z0-9\s]/g,"").replace(/\s\s+/g, "-"))}"
|
|
|
bot.fetchHTML url.replace(/%20/g, '-'), ($) ->
|
|
|
|
0 comments on commit
76c776a