forked from GitHub/dbot
getajob and youare use valMatch and chanceIn
This commit is contained in:
parent
908e957db1
commit
3291586d18
@ -3,8 +3,7 @@ var getAJob = function(dbot) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
'listener': function(data) {
|
'listener': function(data) {
|
||||||
var num = Math.floor(Math.random()*101);
|
if(Number.prototype.chanceIn(1, 50)) {
|
||||||
if(num == 50) {
|
|
||||||
dbot.say(data.channel, data.user + ': Get a job!');
|
dbot.say(data.channel, data.user + ': Get a job!');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -3,10 +3,10 @@ var youAre = function(dbot) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
'listener': function(data) {
|
'listener': function(data) {
|
||||||
var key = data.message.match(/(\bis\b|\bare\b)\s+([\w\s\d]*?)(\s+)?(,|\.|\band\b|$)/);
|
var key = data.message.valMatch(/(\bis\b|\bare\b)\s+([\w\s\d]*?)(\s+)?(,|\.|\band\b|$)/, 5);
|
||||||
|
|
||||||
if(key && Number.prototype.chanceIn(1, 3)) {
|
if(key && key[2] != "" && Number.prototype.chanceIn(1, 3)) {
|
||||||
dbot.say(data.channel, data.user + ': You\'re ' + key[2]);
|
dbot.say(data.channel, data.user + ': You\'re ' + key[2] + '.');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user