Created
September 24, 2014 22:40
-
-
Save dkarzon/156059d76d27a982c482 to your computer and use it in GitHub Desktop.
mmbot formated quotes bro
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
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