Skip to content

Instantly share code, notes, and snippets.

@rickycodes
Created January 10, 2013 18:45
Show Gist options
  • Save rickycodes/4504670 to your computer and use it in GitHub Desktop.
Save rickycodes/4504670 to your computer and use it in GitHub Desktop.
multiline flair.js
/**
* @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