constDiscord=require('discord.js') //npm i discord.jsconstclient=newDiscord.Client()constprodigous=require('prodigous') //npm i prodigousconstprefix="!"client.on('ready', () => {console.log(`logged in as ${client.user.username}`)})client.on('message',async(message) => {constargs=message.content.slice(prefix.length).trim().split(/ +/);constcommand=args.shift().toLowerCase();if(command ==='commandName') {message.channel.send("working")}})client.login("TOKEN")
Have a advance command handler?
The function all works the same way just import the package on every file where you want to use the package
Command list
Economy
Before using any of these methods do the following:
awaitprodigous.connect("MONGO_DB_URI") //Put this at the bottom in index.js or your main file
Balance Command
if(command ==='balance') {let member =message.mentions.users.first() ||message.author;awaitprodigous.balanceCommand(message,member.id)}//Four lines
Reset all command
if(command ==="resetall") {awaitprodigous.resetAll(message) //Resets all the currency to 0}
These methods are still in beta so use it at your own risk
Time command
if(command ==='time') {let member =message.mentions.users.first() ||message.author;awaitprodigous.timeCommand(member.id, message) //get user time spend in vc}