Skip to content

Instantly share code, notes, and snippets.

@dkarzon
Created September 24, 2014 22:40
Show Gist options
  • Save dkarzon/156059d76d27a982c482 to your computer and use it in GitHub Desktop.
Save dkarzon/156059d76d27a982c482 to your computer and use it in GitHub Desktop.
mmbot formated quotes bro
var robot = Require<Robot>();
robot.Respond("((quote)( me)? (.*) by (.*)?)|((quote)( me)? (.*))", msg =>
{
var quote = string.IsNullOrWhiteSpace(msg.Match[4]) ? msg.Match[9] : msg.Match[4];
var byLine = "pikachu";
if (!string.IsNullOrWhiteSpace(msg.Match[5]))
{
byLine = msg.Match[5];
}
msg.SendFormat("\"{0}\" - {1}", quote, byLine);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment