forked from GitHub/dbot
Merge github.com:reality/depressionbot into database
This commit is contained in:
commit
f5fb2322b1
@ -31,11 +31,19 @@ var api = function(dbot) {
|
|||||||
var applies = false;
|
var applies = false;
|
||||||
if(_.has(dbot.commands[commandName], 'regex')) {
|
if(_.has(dbot.commands[commandName], 'regex')) {
|
||||||
var cRegex = dbot.commands[commandName].regex;
|
var cRegex = dbot.commands[commandName].regex;
|
||||||
|
if(_.isArray(cRegex) && cRegex.length == 2) {
|
||||||
var q = event.message.valMatch(cRegex[0], cRegex[1]);
|
var q = event.message.valMatch(cRegex[0], cRegex[1]);
|
||||||
if(q) {
|
if(q) {
|
||||||
applies = true;
|
applies = true;
|
||||||
event.input = q;
|
event.input = q;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
var q = event.message.match(cRegex);
|
||||||
|
if(q) {
|
||||||
|
applies = true;
|
||||||
|
event.input = q;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
applies = true;
|
applies = true;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"ignorable": true
|
"ignorable": true,
|
||||||
|
"help": "https://github.com/reality/depressionbot/blob/master/modules/ctcp/README.md"
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,6 @@
|
|||||||
"password": "yourpasswordhere",
|
"password": "yourpasswordhere",
|
||||||
"dependencies": [ "command" ],
|
"dependencies": [ "command" ],
|
||||||
"ignorable": true,
|
"ignorable": true,
|
||||||
|
"help": "https://github.com/reality/depressionbot/blob/master/modules/dent/README.md",
|
||||||
"dentQuotes": false
|
"dentQuotes": false
|
||||||
}
|
}
|
||||||
|
3
modules/dns/config.json
Normal file
3
modules/dns/config.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"help": "https://github.com/reality/depressionbot/blob/master/modules/dns/README.md"
|
||||||
|
}
|
3
modules/event/config.json
Normal file
3
modules/event/config.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"help": "https://github.com/reality/depressionbot/blob/master/modules/event/README.md"
|
||||||
|
}
|
@ -28,11 +28,8 @@ var flashy = function(dbot) {
|
|||||||
var text = event.input[2].trim().toUpperCase();
|
var text = event.input[2].trim().toUpperCase();
|
||||||
|
|
||||||
if(_.has(this.colourMap, colour)) {
|
if(_.has(this.colourMap, colour)) {
|
||||||
event.reply(dbot.t('url', {
|
event.reply(dbot.api.web.getUrl('flashy/' + colour + '/' +
|
||||||
'host': dbot.config.web.webHost,
|
encodeURIComponent(text)));
|
||||||
'port': dbot.config.web.webPort,
|
|
||||||
'path': 'flashy/' + colour + '/' + encodeURIComponent(text)
|
|
||||||
}));
|
|
||||||
} else {
|
} else {
|
||||||
var possibleColours = _.keys(this.colourMap).join(', ') + '.';
|
var possibleColours = _.keys(this.colourMap).join(', ') + '.';
|
||||||
event.reply('No such colour, brah. Available colours are: ' + possibleColours);
|
event.reply('No such colour, brah. Available colours are: ' + possibleColours);
|
||||||
|
@ -16,12 +16,17 @@ var imgur = function(dbot) {
|
|||||||
if(imgData.title) {
|
if(imgData.title) {
|
||||||
info += imgData.title + ' is ';
|
info += imgData.title + ' is ';
|
||||||
}
|
}
|
||||||
|
if(imgData.type) {
|
||||||
if(imgData.animated) {
|
if(imgData.animated) {
|
||||||
info += 'an animated ' + imgData.type.split('/')[1] + ' with ';
|
info += 'an animated ' + imgData.type.split('/')[1] + ' with ';
|
||||||
} else {
|
} else {
|
||||||
info += 'a non-animated ' + imgData.type.split('/')[1] + ' with ';
|
info += 'a ' + imgData.type.split('/')[1] + ' with ';
|
||||||
}
|
}
|
||||||
info += imgData.views + ' views].';
|
} else {
|
||||||
|
info += 'an image with ';
|
||||||
|
}
|
||||||
|
info += imgData.views + ' views (';
|
||||||
|
info += imgData.width + 'x' + imgData.height + ')].';
|
||||||
}
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
@ -76,15 +81,15 @@ var imgur = function(dbot) {
|
|||||||
|
|
||||||
this.onLoad = function() {
|
this.onLoad = function() {
|
||||||
var imgurHandler = function(event, matches, name) {
|
var imgurHandler = function(event, matches, name) {
|
||||||
if(matches[2]) { // TODO: handle this in the regex
|
if(matches[1]) {
|
||||||
this.api.getImageInfo(matches[1], function(imgData) {
|
this.api.getImageInfo(matches[1], function(imgData) {
|
||||||
var info = this.internalAPI.infoString(imgData);
|
var info = this.internalAPI.infoString(imgData);
|
||||||
if(info) event.reply(info);
|
if(info) event.reply(info);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
dbot.api.link.addHandler(this.name, /http:\/\/i\.imgur\.com\/([a-zA-Z0-9]+)\.([jpg|png|gif])/, imgurHandler);
|
dbot.api.link.addHandler(this.name, /https?:\/\/i\.imgur\.com\/([a-zA-Z0-9]+)\.([jpg|png|gif])/, imgurHandler);
|
||||||
dbot.api.link.addHandler(this.name, /\bhttps?:\/\/imgur\.com\/([a-zA-Z0-9]+)\b/i, imgurHandler);
|
dbot.api.link.addHandler(this.name, /https?:\/\/imgur\.com\/([a-zA-Z0-9]+)/, imgurHandler);
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
78
modules/kick/commands.js
Normal file
78
modules/kick/commands.js
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
var commands = function(dbot) {
|
||||||
|
var commands = {
|
||||||
|
/*** Kick Management ***/
|
||||||
|
'~ckick': function(event) {
|
||||||
|
var server = event.server,
|
||||||
|
kicker = event.user,
|
||||||
|
kickee = event.input[2],
|
||||||
|
channel = event.input[1],
|
||||||
|
reason = event.input[3];
|
||||||
|
|
||||||
|
this.api.kick(server, kickee, channel, reason + ' (requested by ' + kicker + ')');
|
||||||
|
dbot.api.report.notify(server, channel, kicker, kickee, dbot.t('ckicked', {
|
||||||
|
'kicker': kicker,
|
||||||
|
'kickee': kickee,
|
||||||
|
'channel': channel,
|
||||||
|
'reason': reason
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
/*** Kick Stats ***/
|
||||||
|
|
||||||
|
// Give the number of times a given user has been kicked and has kicked
|
||||||
|
// other people.
|
||||||
|
'~kickcount': function(event) {
|
||||||
|
var username = event.params[1];
|
||||||
|
|
||||||
|
if(!_.has(dbot.db.kicks, username)) {
|
||||||
|
var kicks = '0';
|
||||||
|
} else {
|
||||||
|
var kicks = dbot.db.kicks[username];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!_.has(dbot.db.kickers, username)) {
|
||||||
|
var kicked = '0';
|
||||||
|
} else {
|
||||||
|
var kicked = dbot.db.kickers[username];
|
||||||
|
}
|
||||||
|
|
||||||
|
event.reply(dbot.t('user_kicks', {
|
||||||
|
'user': username,
|
||||||
|
'kicks': kicks,
|
||||||
|
'kicked': kicked
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
// Output a list of the people who have been kicked the most and those
|
||||||
|
// who have kicked other people the most.
|
||||||
|
'~kickstats': function(event) {
|
||||||
|
var orderedKickLeague = function(list, topWhat) {
|
||||||
|
var kickArr = _.chain(list)
|
||||||
|
.pairs()
|
||||||
|
.sortBy(function(kick) { return kick[1] })
|
||||||
|
.reverse()
|
||||||
|
.first(10)
|
||||||
|
.value();
|
||||||
|
|
||||||
|
var kickString = "Top " + topWhat + ": ";
|
||||||
|
for(var i=0;i<kickArr.length;i++) {
|
||||||
|
kickString += kickArr[i][0] + " (" + kickArr[i][1] + "), ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return kickString.slice(0, -2);
|
||||||
|
};
|
||||||
|
|
||||||
|
event.reply(orderedKickLeague(dbot.db.kicks, 'Kicked'));
|
||||||
|
event.reply(orderedKickLeague(dbot.db.kickers, 'Kickers'));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
commands['~ckick'].access = 'moderator';
|
||||||
|
commands['~ckick'].regex = [/^~ckick ([^ ]+) ([^ ]+) (.+)$/, 4];
|
||||||
|
|
||||||
|
return commands;
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.fetch = function(dbot) {
|
||||||
|
return commands(dbot);
|
||||||
|
};
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"dbKeys": [ "kicks", "kickers" ],
|
"dbKeys": [ "kicks", "kickers" ],
|
||||||
"dependencies": [ "command" ],
|
"dependencies": [ "command", "report", "users" ],
|
||||||
"help": "http://github.com/reality/depressionbot/blob/master/modules/kick/README.md",
|
"help": "http://github.com/reality/depressionbot/blob/master/modules/kick/README.md",
|
||||||
"ignorable": true
|
"ignorable": true,
|
||||||
|
"countSilently": true
|
||||||
}
|
}
|
||||||
|
@ -1,55 +1,6 @@
|
|||||||
var _ = require('underscore')._;
|
var _ = require('underscore')._;
|
||||||
|
|
||||||
var kick = function(dbot) {
|
var kick = function(dbot) {
|
||||||
var commands = {
|
|
||||||
// Give the number of times a given user has been kicked and has kicked
|
|
||||||
// other people.
|
|
||||||
'~kickcount': function(event) {
|
|
||||||
var username = event.params[1];
|
|
||||||
|
|
||||||
if(!_.has(dbot.db.kicks, username)) {
|
|
||||||
var kicks = '0';
|
|
||||||
} else {
|
|
||||||
var kicks = dbot.db.kicks[username];
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!_.has(dbot.db.kickers, username)) {
|
|
||||||
var kicked = '0';
|
|
||||||
} else {
|
|
||||||
var kicked = dbot.db.kickers[username];
|
|
||||||
}
|
|
||||||
|
|
||||||
event.reply(dbot.t('user_kicks', {
|
|
||||||
'user': username,
|
|
||||||
'kicks': kicks,
|
|
||||||
'kicked': kicked
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
|
|
||||||
// Output a list of the people who have been kicked the most and those
|
|
||||||
// who have kicked other people the most.
|
|
||||||
'~kickstats': function(event) {
|
|
||||||
var orderedKickLeague = function(list, topWhat) {
|
|
||||||
var kickArr = _.chain(list)
|
|
||||||
.pairs()
|
|
||||||
.sortBy(function(kick) { return kick[1] })
|
|
||||||
.reverse()
|
|
||||||
.first(10)
|
|
||||||
.value();
|
|
||||||
|
|
||||||
var kickString = "Top " + topWhat + ": ";
|
|
||||||
for(var i=0;i<kickArr.length;i++) {
|
|
||||||
kickString += kickArr[i][0] + " (" + kickArr[i][1] + "), ";
|
|
||||||
}
|
|
||||||
|
|
||||||
return kickString.slice(0, -2);
|
|
||||||
};
|
|
||||||
|
|
||||||
event.reply(orderedKickLeague(dbot.db.kicks, 'Kicked'));
|
|
||||||
event.reply(orderedKickLeague(dbot.db.kickers, 'Kickers'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
this.commands = commands;
|
|
||||||
|
|
||||||
this.api = {
|
this.api = {
|
||||||
'ban': function(server, user, channel) {
|
'ban': function(server, user, channel) {
|
||||||
@ -79,13 +30,15 @@ var kick = function(dbot) {
|
|||||||
dbot.db.kickers[event.user] += 1;
|
dbot.db.kickers[event.user] += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!this.config.countSilently) {
|
||||||
event.reply(event.kickee + '-- (' + dbot.t('user_kicks', {
|
event.reply(event.kickee + '-- (' + dbot.t('user_kicks', {
|
||||||
'user': event.kickee,
|
'user': event.kickee,
|
||||||
'kicks': dbot.db.kicks[event.kickee],
|
'kicks': dbot.db.kicks[event.kickee],
|
||||||
'kicked': dbot.db.kickers[event.kickee]
|
'kicked': dbot.db.kickers[event.kickee]
|
||||||
}) + ')');
|
}) + ')');
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
}.bind(this);
|
||||||
this.on = 'KICK';
|
this.on = 'KICK';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,5 +10,8 @@
|
|||||||
"es": "No expulsás {botname}",
|
"es": "No expulsás {botname}",
|
||||||
"na'vi": "Ngal {botname}it ke tsun tsrive'i",
|
"na'vi": "Ngal {botname}it ke tsun tsrive'i",
|
||||||
"cy": "Ni ddylech cicio {botname}"
|
"cy": "Ni ddylech cicio {botname}"
|
||||||
|
},
|
||||||
|
"ckicked": {
|
||||||
|
"en": "Attention: {kicker} has kicked {kickee} from {channel}. The reason given was: \"{reason}.\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ var commands = function(dbot){
|
|||||||
if(event.params[1]){
|
if(event.params[1]){
|
||||||
var primary = dbot.api.users.resolveUser(event.server, event.params[1]);
|
var primary = dbot.api.users.resolveUser(event.server, event.params[1]);
|
||||||
if(_.has(dbot.db.profiles[event.server], primary.toLowerCase())){
|
if(_.has(dbot.db.profiles[event.server], primary.toLowerCase())){
|
||||||
event.reply(dbot.api.web.getUrl("/profile/"+event.server+"/"+primary.toLowerCase());
|
event.reply(dbot.api.web.getUrl("profile/"+event.server+"/"+primary.toLowerCase()));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
event.reply("No profile found for "+event.params[1]);
|
event.reply("No profile found for "+event.params[1]);
|
||||||
|
115
modules/reddit/reddit.js
Normal file
115
modules/reddit/reddit.js
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
/**
|
||||||
|
* Module Name: reddit
|
||||||
|
* Description: Various reddit functionality
|
||||||
|
*/
|
||||||
|
var _ = require('underscore')._,
|
||||||
|
request = require('request');
|
||||||
|
|
||||||
|
var reddit = function(dbot) {
|
||||||
|
this.ApiRoot = 'http://reddit.com/';
|
||||||
|
this.UserAgent = 'dbot by u/realitone';
|
||||||
|
|
||||||
|
this.api = {
|
||||||
|
'getSubredditInfo': function(name, callback) {
|
||||||
|
request.get({
|
||||||
|
'url': this.ApiRoot + 'r/' + name + '/about.json',
|
||||||
|
'json': true,
|
||||||
|
'headers': {
|
||||||
|
'User-Agent': this.UserAgent
|
||||||
|
}
|
||||||
|
}, function(err, response, body) {
|
||||||
|
var data = null;
|
||||||
|
if(_.has(body, 'data')) data = body.data;
|
||||||
|
callback(data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
'getPostInfo': function(name, callback) {
|
||||||
|
request.get({
|
||||||
|
'url': this.ApiRoot + 'comments/' + name + '.json',
|
||||||
|
'json': true,
|
||||||
|
'headers': {
|
||||||
|
'User-Agent': this.UserAgent
|
||||||
|
}
|
||||||
|
}, function(err, response, body) {
|
||||||
|
if(body[0] && _.has(body[0], 'data')) {
|
||||||
|
callback(body[0].data.children[0].data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
'getCommentInfo': function(post, name, callback) {
|
||||||
|
request.get({
|
||||||
|
'url': this.ApiRoot + 'comments/' + post + '.json',
|
||||||
|
'qs': {
|
||||||
|
'comment': name
|
||||||
|
},
|
||||||
|
'json': true,
|
||||||
|
'headers': {
|
||||||
|
'User-Agent': this.UserAgent
|
||||||
|
}
|
||||||
|
}, function(err, response, body) {
|
||||||
|
if(body[1] && _.has(body[1], 'data')) {
|
||||||
|
callback(body[1].data.children[0].data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.onLoad = function() {
|
||||||
|
var rHandler = function(event, matches, name) {
|
||||||
|
if(matches[6]) { // It's a comment
|
||||||
|
this.api.getCommentInfo(matches[4], matches[6], function(info) {
|
||||||
|
if(info) {
|
||||||
|
var infoString = dbot.t('about_comment', {
|
||||||
|
'poster': info.author,
|
||||||
|
'subreddit': info.subreddit,
|
||||||
|
'comments': info.num_comments,
|
||||||
|
'score': info.ups - info.downs,
|
||||||
|
'up': info.ups,
|
||||||
|
'down': info.downs
|
||||||
|
});
|
||||||
|
if(info.over_18) infoString += " " + dbot.t("nsfw");
|
||||||
|
event.reply(infoString);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if(matches[4]) { // It's a post
|
||||||
|
this.api.getPostInfo(matches[4], function(info) {
|
||||||
|
if(info) {
|
||||||
|
var infoString = dbot.t('about_post', {
|
||||||
|
'poster': info.author,
|
||||||
|
'subreddit': info.subreddit,
|
||||||
|
'comments': info.num_comments,
|
||||||
|
'score': info.score,
|
||||||
|
'up': info.ups,
|
||||||
|
'down': info.downs,
|
||||||
|
'url': this.ApiRoot + matches[4]
|
||||||
|
});
|
||||||
|
if(info.over_18) infoString += " " + dbot.t("nsfw");
|
||||||
|
event.reply(infoString);
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
} else if(matches[2]) { // It's a subreddit
|
||||||
|
this.api.getSubredditInfo(matches[2], function(info) {
|
||||||
|
if(info) {
|
||||||
|
var infoString = dbot.t('about_subreddit', {
|
||||||
|
'display_name': info.display_name,
|
||||||
|
'subscribers': info.subscribers,
|
||||||
|
'active': info.accounts_active
|
||||||
|
});
|
||||||
|
if(info.over18) infoString += dbot.t("nsfw");
|
||||||
|
event.reply(infoString);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}.bind(this);
|
||||||
|
|
||||||
|
dbot.api.link.addHandler(this.name, // I'm so sorry, Jesus.
|
||||||
|
/https?:\/\/(www\.)?reddit\.com\/r\/([a-zA-Z0-9]+)(\/comments\/([a-zA-Z0-9]+)?\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)?)?/,
|
||||||
|
rHandler);
|
||||||
|
}.bind(this);
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.fetch = function(dbot) {
|
||||||
|
return new reddit(dbot);
|
||||||
|
}
|
14
modules/reddit/strings.json
Normal file
14
modules/reddit/strings.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"about_subreddit": {
|
||||||
|
"en": "[{display_name} has {subscribers} subscribers ({active} active)]"
|
||||||
|
},
|
||||||
|
"about_post": {
|
||||||
|
"en": "[Post by {poster} in {subreddit} — Comments: {comments}, Score: {score} (\u00039▲{up}\u000f|\u000312{down}▼\u000f)] — {url}"
|
||||||
|
},
|
||||||
|
"about_comment": {
|
||||||
|
"en": "[Comment by {poster} in {subreddit} — Score: {score} (\u00039▲{up}\u000f|\u000312{down}▼\u000f)]"
|
||||||
|
},
|
||||||
|
"nsfw": {
|
||||||
|
"en": "[NSFW]"
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +1,9 @@
|
|||||||
var _ = require('underscore')._;
|
var _ = require('underscore')._;
|
||||||
|
|
||||||
var report = function(dbot) {
|
var report = function(dbot) {
|
||||||
var commands = {
|
this.api = {
|
||||||
'~report': function(event) {
|
'notify': function(server, channel, reporter, reported, message) {
|
||||||
var channelName = event.input[1];
|
var channel = dbot.instance.connections[server].channels[channel];
|
||||||
var nick = event.input[2];
|
|
||||||
var reason = event.input[3];
|
|
||||||
|
|
||||||
if(_.has(event.allChannels, channelName)) {
|
|
||||||
var channel = event.allChannels[channelName];
|
|
||||||
if(dbot.api.users.isChannelUser(event.server, nick, channelName, true)) {
|
|
||||||
var nick = dbot.api.users.resolveUser(event.server, nick, true);
|
|
||||||
var ops = _.filter(channel.nicks, function(user) {
|
var ops = _.filter(channel.nicks, function(user) {
|
||||||
if(this.config.notifyVoice) {
|
if(this.config.notifyVoice) {
|
||||||
return user.op || user.voice;
|
return user.op || user.voice;
|
||||||
@ -20,18 +13,32 @@ var report = function(dbot) {
|
|||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
_.each(ops, function(user) {
|
_.each(ops, function(user) {
|
||||||
dbot.say(event.server, user.name, dbot.t('report', {
|
dbot.say(server, user.name, message);
|
||||||
|
}, this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var commands = {
|
||||||
|
'~report': function(event) {
|
||||||
|
var channelName = event.input[1];
|
||||||
|
var nick = event.input[2];
|
||||||
|
var reason = event.input[3];
|
||||||
|
|
||||||
|
if(_.has(event.allChannels, channelName)) {
|
||||||
|
if(dbot.api.users.isChannelUser(event.server, nick, channelName, true)) {
|
||||||
|
nick = dbot.api.users.resolveUser(event.server, nick, true);
|
||||||
|
this.api.notify(event.server, channelName, event.user, nick, dbot.t('report', {
|
||||||
'reporter': event.user,
|
'reporter': event.user,
|
||||||
'reported': nick,
|
'reported': nick,
|
||||||
'channel': channelName,
|
'channel': channelName,
|
||||||
'reason': reason
|
'reason': reason
|
||||||
}));
|
}));
|
||||||
}, this);
|
|
||||||
|
|
||||||
event.reply(dbot.t('reported', { 'reported': nick }));
|
event.reply(dbot.t('reported', { 'reported': nick }));
|
||||||
} else {
|
} else {
|
||||||
event.reply(dbot.t('user_not_found', { 'reported': nick,
|
event.reply(dbot.t('user_not_found', {
|
||||||
'channel': channelName }));
|
'reported': nick,
|
||||||
|
'channel': channelName
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
event.reply(dbot.t('not_in_channel', { 'channel': channelName }));
|
event.reply(dbot.t('not_in_channel', { 'channel': channelName }));
|
||||||
|
3
modules/timers/config.json
Normal file
3
modules/timers/config.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"help": "https://github.com/reality/depressionbot/blob/master/modules/timers/README.md"
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"webHost": "localhost",
|
"webHost": "localhost",
|
||||||
"webPort": 8080,
|
"webPort": 8080,
|
||||||
"externalPath": false
|
"externalPath": false,
|
||||||
|
"help": "https://github.com/reality/depressionbot/blob/master/modules/web/README.md"
|
||||||
}
|
}
|
||||||
|
@ -41,12 +41,15 @@ var webInterface = function(dbot) {
|
|||||||
|
|
||||||
this.api = {
|
this.api = {
|
||||||
'getUrl': function(path) {
|
'getUrl': function(path) {
|
||||||
|
console.log(path);
|
||||||
if(this.config.externalPath) {
|
if(this.config.externalPath) {
|
||||||
|
console.log('external');
|
||||||
return this.config.externalPath + '/' + path;
|
return this.config.externalPath + '/' + path;
|
||||||
} else {
|
} else {
|
||||||
return 'http://' + this.config.webHost + ':' + port + '/' + path;
|
console.log('internal');
|
||||||
|
return 'http://' + this.config.webHost + ':' + this.config.webPort + '/' + path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user