discordjs / Commando

Official command framework for discord.js
Apache License 2.0
496 stars 241 forks source link

Issues #55

Closed ghost closed 7 years ago

ghost commented 7 years ago

Code

const commando = require('discord.js-commando');
var cleverbot = require("cleverbot.io"),

class TalkCommand extends commando.Command {
  constructor(client) {
    super(client, {
      name: 'talk',
      group: 'general',
      memberName: 'talk',
      description: "Shows information about Mitro",
      aliases: ['t']
    });
  }
  async run(message, args) {
    cleverb = new cleverbot("private", "private");
    cleverb.setNick("Nitro");
    bot.create(function (err, session) {
      bot.ask("Just a small town girl", function (err, response) {
        console.log(response); // Will likely be: "Living in a lonely world"
      });
});
  }
}

module.exports = TalkCommand;

Error:

(node:5396) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'map' of null
(node:5396) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Does anyone have any ideas?

SpaceEEC commented 7 years ago

This has been fixed in latest master, see #51 Or set an owner (for example yourself) in the CommandoClientOptions (see my answer in the linked issue).

FaiqGaming commented 6 years ago

command is not contructor!