Skip to content

Error when calling loadPlugin() with one arg #3

@haku

Description

@haku

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', {});.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions