Closed reynir closed 10 years ago
Ignore the first argument, i.e. use args.splice(1) instead of args
I think this is how we should do it. @clone1018 opinion?
Do not send the first bit
as argument to the plugin -- the plugin can make a callback for each plugin-command if necessary. I don't know if this works with the factoid plugin.
I'm not sure what you mean, can you please explain? Thanks.
I'm not sure what you mean, can you please explain? Thanks.
@KamalN7 I meant that bot.js should filter out the command. In code it would be something like this:
this.emit('command.' + command, from, to, filterOutFirstWord(message), message.split(' ').splice(1));
The plugin should know what the string is anyway -- they can always make one callback/hook per plugin command if they need to know exactly which command triggered it.
I figure most plugins would filer out the first word / element anyway.
Oh, got it.
Fixed it in db8796d until @clone1018 responds
For example, when a client types
.g <query>
the plugin will give the search results for the stringg <query>
.Possible fixes
<config.command><plugin-command>
as argument to the plugin -- the plugin can make a callback for each plugin-command if necessary. I don't know if this works with the factoid plugin.