node-ircbot icon indicating copy to clipboard operation
node-ircbot copied to clipboard

Error when calling loadPlugin() with one arg

Open haku opened this issue 11 years ago • 0 comments

In the example bot.js you show loading a plugin with only one arg, e.g. b.loadPlugin('dice');.

However this will error on the line: pl.cmdPrefix = options.cmdprefix && options.cmdprefix[0] ? options.cmdprefix[0] : '!'; with 'Cannot read property 'cmdprefix' of undefined'. That line should probably read something like: pl.cmdPrefix = options && options.cmdprefix && options.cmdprefix[0] ? options.cmdprefix[0] : '!';

In the mean time the work around is using b.loadPlugin('dice', {});.

haku avatar Oct 10 '13 19:10 haku