Created
January 10, 2013 18:45
-
-
Save rickycodes/4504670 to your computer and use it in GitHub Desktop.
multiline flair.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @module flair | |
*/ | |
const irc = require( "irc-js" ) | |
const FLAIR = | |
[ [ /\balligator\b/i, "---,==,'<" ] | |
, [ /\bshrugs\b/i, "¯\\_(ツ)_/¯" ] | |
, [ /\by u\b/i, "(屮'Д')屮" ] | |
, [ /\bdentata\b/i, [ "(▼▼▼▼▼▼▼▼▼)" | |
, "8==========D" | |
, "(▲▲▲▲▲▲▲▲▲)" ] ] | |
, [ /\gol\b/i, [ " _,...,_" | |
, " .'@/~~~\@'." | |
, " //~~\___/~~\\" | |
, "|@\__/@@@\__/@|" | |
, "|@/ \@@@/ \@|" | |
, " \\__/~~~\__//" | |
, " '.@\___/@.'" ] ] | |
, [ /\bb-ot-love\b/i, [ "I", "♥", "U" ] ] | |
] | |
const speak = function( reply, msg ) { | |
if ( reply === Object( reply ) ) { | |
reply.forEach( function( reply ) { | |
msg.reply( reply ) | |
} ) | |
} else { | |
msg.reply( reply ) | |
} | |
} | |
const load = function( bot ) { | |
FLAIR.forEach( function( f ) { | |
bot.match( f[0], speak.bind( null, f[1] ) ) | |
} ) | |
return irc.STATUS.SUCCESS | |
} | |
const unload = function() { | |
return irc.STATUS.SUCCESS | |
} | |
exports.name = "Flair" | |
exports.load = load | |
exports.unload = unload | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment