mvbot
mvbot copied to clipboard
Update code for Discord.js 13.x (suggestion / note for later)
FYI,
if you update Discord.js you'll have to modify the base branch as follows:
var bot = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] }); // NEW
try {
bot.user.setPresence({
activities: [{
name: 'ver. ' + pkg_info.version
}],
status: 'online'
})
} catch (error) {
console.error(error); //NEW
}
// console.log('mvbot ready!\n');
});
if (!message.member.permissions.has(Permissions.FLAGS.MANAGE_MESSAGES))
because:
- client instanciation requires Intents
- setpresence no longer returns a Promise object (so .then does no longer work)
- use of explicit strings for permissions is discouraged
Also, message.send has been deprecated, and replaced messageCreation, but I haven't figured the exact syntax yet
chers,
Thanks for the insight and taking the time to look into it. This will certainly be helpful when I get around to updating this project again.