This commit is contained in:
Christopher Cookman 2023-04-22 18:57:15 -06:00
parent 71911487a8
commit fb4c7a1e8e
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -70,7 +70,7 @@ client.on("messageCreate", async message => {
if (message.channel.type === "DM") return; if (message.channel.type === "DM") return;
if (config.discord.levels.blacklist.includes(message.channel.id)) return; if (config.discord.levels.blacklist.includes(message.channel.id)) return;
if (config.discord.levels.blacklist.includes(message.channel.parentId)) return; if (config.discord.levels.blacklist.includes(message.channel.parentId)) return;
// Calculate random xp // Calculate random xp
let xp = Math.floor(Math.random() * 10) + 15; let xp = Math.floor(Math.random() * 10) + 15;
// If user is not in database, add them, {user: {xp = xp, lvl = 1, totalXp: xp, msgCount = 1}} // If user is not in database, add them, {user: {xp = xp, lvl = 1, totalXp: xp, msgCount = 1}}
@ -234,7 +234,10 @@ client.on("interactionCreate", async interaction => {
if (err) { if (err) {
console.error(err); console.error(err);
} }
if (!row) return interaction.reply({ content: "This user has not sent any messages yet.", ephemeral: true }); if (!row) return interaction.reply({
content: "This user has not sent any messages yet.",
ephemeral: true
});
if (row) { if (row) {
var data = row; var data = row;
let lvl = data.lvl; let lvl = data.lvl;
@ -339,4 +342,4 @@ console.log(`${colors.cyan("[INFO]")} Starting...`)
// Start timer to see how long startup takes // Start timer to see how long startup takes
const initTime = Date.now() const initTime = Date.now()
// Login to Discord // Login to Discord
client.login(config.discord.token); client.login(config.discord.token);