Answers for "discord js how to make a simple currency system in discord.js"

0

discord js how to make a simple currency system in discord.js

//listen i'm not very good at this but at least it works
//also if you reset the bot the currency will be reseted

client.on('message' , message => {
	if(message.content === '!add'){
    	const User = message.author //we are using message.author for the id
		if(!User.currency) User.currency = 0//you can use whatever name for your currency but im just gonna use 'currency'
      	const currency = User.currency
		let result = currency + 1 //i'm gonna use 1 for example
		user.currency = result

		console.log(currency) //you should see your currency in the terminal
    }
})
Posted by: Guest on August-18-2021

Code answers related to "discord js how to make a simple currency system in discord.js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language