const Discord = require("discord.js");
const Client = new Discord.Client;
const fs = require('fs')
const userCoin = JSON.parse(fs.readFileSync('Storage/userCoin.json', 'utf-8'));
function doSomething() {
const guild = Client.guilds.cache.get('925830522138148976');
const channel2up22 = guild.channels.cache.get('966206342740181012');
let Embed = new Discord.MessageEmbed()
.setTitle("Wild Gift π ! | GuinGame - v2.0 π°")
.setColor('#caabd0')
.setDescription("Be the **first** to react ``'π'`` to this message to win **10 πͺ!**")
.setThumbnail("https://media.giphy.com/media/Jv1Xu8EBCOynpoGBwd/giphy.gif")
.setFooter(text="π€ GuinbearBot | π Guinbeargang.io")
.setTimestamp()
channel2up22.send(Embed).then(message => {
message.react('π');
}).catch(console.error);
}
Client.on('messageReactionAdd', (reaction, user) => {
const guild = Client.guilds.cache.get('925830522138148976');
const channel2up22 = guild.channels.cache.get('966206342740181012');
if (reaction.message.channel.id == channel2up22) {
if (reaction.emoji.name == 'π' && user.id !== "936254253285146635") {
reaction.message.delete();
var Magic09 = 1;
while (Magic09 <= 10) {
userCoin[user.id].CoinsAmount;
Magic09++;
}
fs.writeFile('Storage/userCoin.json', JSON.stringify(userCoin), (err) => {
if (err) console.error(err);
})
let Embed = new Discord.MessageEmbed()
.setTitle("Wild Gift π ! | GuinGame - v2.0 π°")
.setColor('#caabd0')
.setDescription(`${user} has won the **Wild Gift π !**`)
.setThumbnail("https://media.giphy.com/media/Jv1Xu8EBCOynpoGBwd/giphy.gif")
.setFooter(text="π€ GuinbearBot | π Guinbeargang.io")
.setTimestamp()
channel2up22.send(Embed)
}
}
});
Client.on('ready', () => {
setInterval(doSomething, 5000)
});
* Be the first to Make Comment