forked from GitHub/dbot
classify
This commit is contained in:
parent
e608491360
commit
4aed2a700c
@ -42,8 +42,10 @@ var drama = function(dbot) {
|
|||||||
dbot.say(data.channel, '\'' + msg + '\' classified as \'' + category + '\'');
|
dbot.say(data.channel, '\'' + msg + '\' classified as \'' + category + '\'');
|
||||||
},
|
},
|
||||||
|
|
||||||
'~classify': function() {
|
'~classify': function(data, params) {
|
||||||
bayes.classify(data.message, function(category) {
|
params.splice(0, 1);
|
||||||
|
var msg = params.join(' ');
|
||||||
|
bayes.classify(msg, function(category) {
|
||||||
dbot.say(data.channel, 'Classified as: ' + category + '!');
|
dbot.say(data.channel, 'Classified as: ' + category + '!');
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user