forked from GitHub/dbot
Merge branch 'master' of https://github.com/reality/dbot
This commit is contained in:
commit
80ff91b609
@ -59,7 +59,7 @@ var reddit = function(dbot) {
|
|||||||
if(!err && posts.length > 0) {
|
if(!err && posts.length > 0) {
|
||||||
_.each(posts, function(post) {
|
_.each(posts, function(post) {
|
||||||
dbot.say(channel.server, channel.channel, dbot.t('about_post', {
|
dbot.say(channel.server, channel.channel, dbot.t('about_post', {
|
||||||
'title': post.title.trim(),
|
'title': _.unescape(post.title.trim()),
|
||||||
'poster': post.author,
|
'poster': post.author,
|
||||||
'subreddit': post.subreddit,
|
'subreddit': post.subreddit,
|
||||||
'comments': post.num_comments,
|
'comments': post.num_comments,
|
||||||
@ -260,7 +260,7 @@ var reddit = function(dbot) {
|
|||||||
this.api.getPostInfo(matches[4], function(info) {
|
this.api.getPostInfo(matches[4], function(info) {
|
||||||
if(info) {
|
if(info) {
|
||||||
var infoString = dbot.t('about_post', {
|
var infoString = dbot.t('about_post', {
|
||||||
'title': info.title.trim(),
|
'title': _.unescape(info.title.trim()),
|
||||||
'poster': info.author,
|
'poster': info.author,
|
||||||
'subreddit': info.subreddit,
|
'subreddit': info.subreddit,
|
||||||
'comments': info.num_comments,
|
'comments': info.num_comments,
|
||||||
@ -297,7 +297,7 @@ var reddit = function(dbot) {
|
|||||||
this.api.getPostInfo(match[2], function(info) {
|
this.api.getPostInfo(match[2], function(info) {
|
||||||
if(info) {
|
if(info) {
|
||||||
var infoString = dbot.t('about_post', {
|
var infoString = dbot.t('about_post', {
|
||||||
'title': info.title.trim(),
|
'title': _.unescape(info.title.trim()),
|
||||||
'poster': info.author,
|
'poster': info.author,
|
||||||
'subreddit': info.subreddit,
|
'subreddit': info.subreddit,
|
||||||
'comments': info.num_comments,
|
'comments': info.num_comments,
|
||||||
|
@ -64,7 +64,7 @@ var youtube = function(dbot) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.commands = {
|
this.commands = {
|
||||||
'~youtube': function(event) {
|
'~yt': function(event) {
|
||||||
this.api.search(event.input[1], function(body) {
|
this.api.search(event.input[1], function(body) {
|
||||||
if(_.isObject(body) && _.has(body, 'feed') && _.has(body.feed, 'entry')) {
|
if(_.isObject(body) && _.has(body, 'feed') && _.has(body.feed, 'entry')) {
|
||||||
event.reply(this.internalAPI.formatLink(body.feed.entry[0]));
|
event.reply(this.internalAPI.formatLink(body.feed.entry[0]));
|
||||||
@ -74,7 +74,7 @@ var youtube = function(dbot) {
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.commands['~youtube'].regex = [/^youtube (.+)$/, 2];
|
this.commands['~yt'].regex = [/^yt (.+)$/, 2];
|
||||||
|
|
||||||
this.onLoad = function() {
|
this.onLoad = function() {
|
||||||
dbot.api.link.addHandler(this.name, this.LinkRegex,
|
dbot.api.link.addHandler(this.name, this.LinkRegex,
|
||||||
|
Loading…
Reference in New Issue
Block a user