const webdict = require('webdict');

listen(regexFactory.startsWith("urban"), function(match, data, replyTo) {
  if (match[1]){
    webdict('urbandictionary', match[1])
    .then(response => {
      console.log(response);
      if (response && response.statusCode === '200' && response.message === 'success'){
        irc.privmsg(replyTo, response.definition[0]);
      }
      /*
      {
        statusCode: '200',
        message: 'success',
        type: 'Unknown',
        definition: [
          'what you say when your talking casually with friends and your mom walks in the room',
          'The only word on this site that has nothing to do with [sex] or [drugs]!',
          '1.  A greeting\r\n2.  A for of incredulity'
        ],
        source: 'http://urbandictionary.com'
      }
    */
    });
  }
});

@@ -315,28 +315,17 @@
     
-irc.privmsg(replyTo,
+var txt =
  res
@@ -343,16 +343,99 @@
 ition%5B0%5D
+%0A        txt = txt.replace(/(?:%5Cr%5Cn%7C%5Cr%7C%5Cn)/g, ' ')%0A        irc.privmsg(replyTo, txt
 );%0A     

fix urban