Я пытаюсь запустить
node index.js
И я получаю эту ошибку.
Apr 11 10:33:24 metisbot heroku/worker.1 State changed from crashed to starting
Apr 11 10:33:33 metisbot heroku/worker.1 Starting process with command node index.js
Apr 11 10:33:33 metisbot heroku/worker.1 State changed from starting to up
Apr 11 10:33:35 metisbot heroku/worker.1 State changed from up to crashed
Apr 11 10:33:35 metisbot heroku/worker.1 Process exited with status 1
Apr 11 10:33:35 metisbot app/worker.1 /app/node_modules/discord.js-commando/src/registry.js:68
Apr 11 10:33:35 metisbot app/worker.1 const existing = this.groups.get(group.id);
Apr 11 10:33:35 metisbot app/worker.1 ^
Apr 11 10:33:35 metisbot app/worker.1
Apr 11 10:33:35 metisbot app/worker.1 TypeError: Cannot read property 'id' of undefined
Apr 11 10:33:35 metisbot app/worker.1 at CommandoRegistry.registerGroup (/app/node_modules/discord.js-commando/src/registry.js:68:42)
Apr 11 10:33:35 metisbot app/worker.1 at CommandoRegistry.registerGroups (/app/node_modules/discord.js-commando/src/registry.js:108:14)
Apr 11 10:33:35 metisbot app/worker.1 at Object. (/app/index.js:35:4)
Apr 11 10:33:35 metisbot app/worker.1 at Module._compile (internal/modules/cjs/loader.js:1158:30)
Apr 11 10:33:35 metisbot app/worker.1 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
Apr 11 10:33:35 metisbot app/worker.1 at Module.load (internal/modules/cjs/loader.js:1002:32)
Apr 11 10:33:35 metisbot app/worker.1 at Function.Module._load (internal/modules/cjs/loader.js:901:14)
Apr 11 10:33:35 metisbot app/worker.1 at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
Apr 11 10:33:35 metisbot app/worker.1 at internal/main/run_main_module.js:18:47
Вот файл, в котором выдает ошибку коммандос: https://github.com/discordjs/Commando/blob/master/src/registry.js
Вот мой индекс. js:
const { Structures } = require('discord.js');
const path = require('path');
const { prefix, token } = require('./config.json');
var module = new module.constructor();
Structures.extend('Guild', Guild => {
class MusicGuild extends Guild {
constructor(client, data) {
super(client, data);
this.musicData = {
queue: [],
isPlaying: false,
nowPlaying: null,
songDispatcher: null,
volume: 1
};
this.triviaData = {
isTriviaRunning: false,
wasTriviaEndCalled: false,
triviaQueue: [],
triviaScore: new Map()
};
}
}
return MusicGuild;
});
const client = new CommandoClient({
commandPrefix: prefix,
owner: '601420236335480842' // change this to your Discord user ID
});
client.registry
.registerGroups([
['music', 'Music Command Group'],
['gifs', 'Gif Command Group'],
['other', 'random types of commands group'],
['guild', 'guild related commands']
['fun', 'fun stuff']
])
.registerDefaultGroups()
.registerDefaultCommands({
eval: true,
prefix: false,
commandState: false
})
.registerCommandsIn(path.join(__dirname, 'commands'));
client.once('ready', () => {
console.log('Ready!');
let activities = [ 'Bruh, thats so epic', 'created by ListenHere#4262', 'type =help for help', `Type ${prefix}rr`, 'xphos is an epic gamer' ], i = 0;
setInterval(() => client.user.setActivity(`${activities[i++ % activities.length]}`, { type: "WATCHING" }), 5000)
});
client.login(token);