const Discord = require("discord.js");
const bot = new Discord.Client();
bot.on("ready", async () => {
console.log("Bot Connected");
global.tdict = {};
await bot.user.setActivity("r!help", { type: "PLAYING" });
});
bot.on("voiceStateUpdate", async (before, after) => {
const author = before.member.id || after.member.id;
if (!before.channel && after.channel) {
console.log("1");
const t1 = Math.floor(Date.now() / 1000);
global.tdict[author] = t1;
} else if (before.channel && !after.channel && global.tdict.hasOwnProperty(author)) {
const t2 = Math.floor(Date.now() / 1000);
console.log("0");
console.log(t2 - global.tdict[author]);
}
});
const rank = clanTable.members[0].userRank;
const id = clanTable.members[0].userID;