Change Log

Important Changes for Version 1.2.6 : Highly anticipated functionalities of 'requiredRoles' and `init` have been added.

  • The 'init' functionality executes the block of code present inside it as soon as the ready event of the bot is fired!

  • Now with required role feature , you do not have to give a specific permission and instead a role will do .

Required Roles feature is highly useful when you do not want to give explicit permission to a person and instead make them use the bot for that purpose for ease of logging their actions !

Here is an example for required roles and init feature :

Basically , this if the Member does not have the ADMIN rights but has the one of the roles specified then they are eligible to run the command !

const { Permissions } = require("discord.js")

module.exports = {
    name : 'status',
    description : "Changes the status of the bot !",
    requiredRoles : ['1001500768563638346'], // Please give in the Role Ids as an array.
    permissions : [ Permissions.FLAGS.ADMINISTRATOR], 
    async init(client) {
        await client.user.setActivity("PLAYING SOMETHING" , {type : "PLAYING"}) // This sets the default Status of the bot after logging in.
    },
    async execute({message , client , args}){
       await client.user.setActivity(args.join(" ") , {type : "PLAYING"}) // Sets the status provided by the Member.
       return message.reply({content : "✅ Successfully set the status !"})
    }
}

Last updated