Skip to content

Commit

Permalink
Coins for messages (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
RegisCoaxans authored Jan 7, 2025
1 parent d95be41 commit d1782e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { InteractionType } = require('discord.js');
const fs = require('fs');
const Discord = require('discord.js');
const SpamDetection = require('./other/mod/spamdetection.js');
const { development, prefix, token, backupChannelID } = require('./config.js');
const { development, prefix, token, backupChannelID, quizChannelID } = require('./config.js');
const {
log,
info,
Expand All @@ -23,6 +23,7 @@ const {
backupDB,
addPurchased,
addStatistic,
addAmount,
} = require('./database.js');
const regexMatches = require('./regexMatches.js');
const { newQuiz } = require('./other/quiz/quiz.js');
Expand Down Expand Up @@ -177,6 +178,9 @@ client.on('error', e => error('Client error thrown:', e))
const timeLeft = cooldownTimeLeft('messages', 30, message.author.id);
if (!timeLeft) {
const messagesSent = await addStatistic(message.author, 'messages');
if (message.channel.id !== quizChannelID) {
await addAmount(message.author, 1, 'coins');
}
if (messagesSent == 2500) {
const congratsEmbed = new Discord.EmbedBuilder().setTitle('Congratulations!').setColor('Random').setDescription([
message.author.toString(),
Expand Down

0 comments on commit d1782e6

Please sign in to comment.