superscript: Filter functions not working
On branch v1.0.0
SS:FilterFunction Reply filter function found: ^sigh("true") +19ms
SS:Utils Running plugin function with name: sigh +1ms
SS:Utils Calling plugin function: sigh with args: true,function (err, filterReply) {
if (err) {
console.error(err);
return resolve(false);
}
if (filterReply === 'true' || filterReply === true) {
return resolve(true);
}
return resolve(false);
} +8ms
SS:FilterFunction Reply filter function found: ^sigh("false") +1ms
SS:Utils Running plugin function with name: sigh +0ms
SS:Utils Calling plugin function: sigh with args: false,function (err, filterReply) {
if (err) {
console.error(err);
return resolve(false);
}
if (filterReply === 'true' || filterReply === true) {
return resolve(true);
}
return resolve(false);
} +1ms
SS:FilterSeen filterRepliesBySeen +1ms []
SS:GetReply Bucket of selected replies: +0ms []
SS:GetReply Pick Scheme: +1ms random
SS:GetReply Set of matches: +2ms
SS:GetReply afterHandle +5ms { replyId: null,
replyIds: null,
props: {},
clearConversation: false,
topicName: null,
debug: [],
string: '',
subReplies: [],
stars: null,
continueMatching: null }
SS:Message Message received was empty, callback immediately +0ms
Could not write log to file with path: /home/sephvelut/app/bot/logs/ffff127001_trans.txt.log
SS:User Updating History +2ms
SS:SuperScript Update and Reply to user '::ffff:127.0.0.1' +0ms
SS:SuperScript [ Final Reply - '::ffff:127.0.0.1']- '' +1ms
+ test
- ok
+ qq
- {^sigh("true")} asd
- {^sigh("false")} poi
exports.sigh = function(bool, cb) {
cb(null, false);
};
The filter function does get fired off, but the bot never replies with anything.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16
For the sake of completion, we do have another system that might work… but it is for managing conversation state/flow.
I think the custom function should return
trueif you want to see the reply, andfalseif you want to filter it out, though I may be going crazy. Maybe it should be the other way around?