Browse Source

regex battle

pull/11/head
calexil 4 years ago
parent
commit
e3ca62292a
  1. 7
      bot.js
  2. 8
      bot.js~

7
bot.js

@ -9,12 +9,19 @@ const bodyParser = require('body-parser'); @@ -9,12 +9,19 @@ const bodyParser = require('body-parser');
// Message Array
const responseObject = {
"test": "It worked!",
"best girl?": "Big Band.",
"best girl": "Big Band.",
"best grill": "Big Band.",
"best grill?": "Big Band.",
"best gurl": "Big Band.",
"best gurl?": "Big Band.",
"best booty": "Squigly, Duh.",
"best booty?": "Squigly, Duh.",
"hi": "Hello there, I'm a dumb bot written by [@calexil#9270](https://github.com/calexil) and [@Timberius#8180](https://github.com/TimboKZ) , you can see my commands here: https://github.com/calexil/BansheeBot/blob/master/Commands.md",
"commands": "You can see my commands here: https://github.com/calexil/BansheeBot/blob/master/Commands.md"
};
console.log("best girl?".replace(/best g(ir|ri|ur)l+\??/g, "Big Band."));
// Call the web page with express
app.use(express.static('public'));

8
bot.js~

@ -9,6 +9,12 @@ const bodyParser = require('body-parser'); @@ -9,6 +9,12 @@ const bodyParser = require('body-parser');
// Message Array
const responseObject = {
"test": "It worked!",
"best girl?": "Big Band.",
"best girl": "Big Band.",
"best grill": "Big Band.",
"best grill?": "Big Band.",
"best gurl": "Big Band.",
"best gurl?": "Big Band.",
"best booty": "Squigly, Duh.",
"best booty?": "Squigly, Duh.",
"hi": "Hello there, I'm a dumb bot written by [@calexil#9270](https://github.com/calexil) and [@Timberius#8180](https://github.com/TimboKZ) , you can see my commands here: https://github.com/calexil/BansheeBot/blob/master/Commands.md",
@ -44,7 +50,7 @@ client.on('ready', () => { @@ -44,7 +50,7 @@ client.on('ready', () => {
if (!musicChannel) console.error('Could not find music channel!');
console.log('I am ready!');
console.log("best girl?".replace(/best g(ir|ri|ur)l+\??/gi, "Big Band."));
console.log("best girl?".replace(/best g(ir|ri|ur)l+\??/g, "Big Band."));
});
// Reply to keywords in the array

Loading…
Cancel
Save