Ich mache einen Bot und möchte ein Präfix, um den Bot aufrufen. Es funktioniert zu ändern, wenn Sie keine Gruppen haben. Aber wie ändere ich das Präfix "!" Wann benutze ich Gruppen?Ändern Präfix für Diskord Bot in Javascript
Mein Hauptcode
const commando = require('discord.js-commando');
const bot = new commando.Client();
const prefix = ":D";
bot.registry.registerGroup('random', 'Random');
bot.registry.registerCommandsIn(__dirname + "/commands");
bot.login('Botcode'
);
Meine Gruppe
const commando = require('discord.js-commando');
class DiceRollCommand extends commando.Command {
constructor(client) {
super(client, {
name: 'roll',
group: 'random',
memberName: 'roll',
description: 'Roll a die'
});
}
async run(message, args){
var roll = Math.floor(Math.random() * 6) + 1;
message.reply("You rolled a " + roll);
}
}
module.exports = DiceRollCommand;
Wenn Sie Hilfe benötigen, benötigen wir Code. Bearbeiten Sie Ihre Frage so, dass sie ein [** minimales, vollständiges, überprüfbares Beispiel **] (https://stackoverflow.com/help/mcve) enthält. – Santi