Skip to content

Error when calling loadPlugin() with one arg #3

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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