Skip to content
This repository was archived by the owner on Jul 17, 2020. It is now read-only.

Commit f69f01a

Browse files
author
Zirak
committed
Added /meme list and three requested memes.
1 parent a63fcc2 commit f69f01a

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

master.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4495,6 +4495,8 @@ var urlBase = 'http://cdn.alltheragefaces.com/img/faces/png/',
44954495

44964496
var memes = {
44974497
deskflip : 'angry-desk-flip',
4498+
fuu : 'rage-classic',
4499+
iseewhatyoudidthere : 'happy-i-see-what-you-did-there-(clean)',
44984500
no : 'angry-no',
44994501
notbad : 'obama-not-bad',
45004502
ohyou : 'happy-oh-stop-it-you',
@@ -4530,15 +4532,18 @@ bot.addCommand({
45304532
fun : function ( args ) {
45314533
var name = args.replace( /\.\w+$/, '' );
45324534

4533-
if ( !memes[name] ) {
4535+
if ( !name || name === 'list' ) {
4536+
return Object.keys( memes ).join( ', ' );
4537+
}
4538+
else if ( !memes.hasOwnProperty(name) ) {
45344539
return 'Sorry, I don\'t know that one.';
45354540
}
4536-
//TODO: list possible memes (reply with Object.keys(meme))
45374541

45384542
args.directreply( getMemeLink(name) );
45394543
},
45404544
permissions : { del : 'NONE' },
4541-
description : 'Return a simple meme link. `/meme memeName`'
4545+
description : 'Return a simple meme link. Pass no arguments or `list` to ' +
4546+
'get a list of known memes. `/meme [memeName]`.'
45424547
});
45434548

45444549
function getMemeLink ( meme ) {
@@ -5778,7 +5783,7 @@ var unonebox = {
57785783
var frag = document.createElement( 'div' );
57795784
frag.innerHTML = msgObj.content;
57805785
// do not un-onebox youtube videos and quotes
5781-
var link = frag.querySelector( '.onebox:not(.ob-youtube):not(.ob-message) a' );
5786+
var link = frag.querySelector( '.onebox:not(.ob-youtube):not(.ob-message):not(.ob-wikipedia) a' );
57825787

57835788
// No onebox, no un-oneboxing.
57845789
// ugly fix for quoted messages as well.

master.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/plugins/meme.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ var urlBase = 'http://cdn.alltheragefaces.com/img/faces/png/',
66

77
var memes = {
88
deskflip : 'angry-desk-flip',
9+
fuu : 'rage-classic',
10+
iseewhatyoudidthere : 'happy-i-see-what-you-did-there-(clean)',
911
no : 'angry-no',
1012
notbad : 'obama-not-bad',
1113
ohyou : 'happy-oh-stop-it-you',
@@ -41,15 +43,18 @@ bot.addCommand({
4143
fun : function ( args ) {
4244
var name = args.replace( /\.\w+$/, '' );
4345

44-
if ( !memes[name] ) {
46+
if ( !name || name === 'list' ) {
47+
return Object.keys( memes ).join( ', ' );
48+
}
49+
else if ( !memes.hasOwnProperty(name) ) {
4550
return 'Sorry, I don\'t know that one.';
4651
}
47-
//TODO: list possible memes (reply with Object.keys(meme))
4852

4953
args.directreply( getMemeLink(name) );
5054
},
5155
permissions : { del : 'NONE' },
52-
description : 'Return a simple meme link. `/meme memeName`'
56+
description : 'Return a simple meme link. Pass no arguments or `list` to ' +
57+
'get a list of known memes. `/meme [memeName]`.'
5358
});
5459

5560
function getMemeLink ( meme ) {

0 commit comments

Comments
 (0)