added settings

This commit is contained in:
DeSqBlocki
2025-02-13 21:04:53 +01:00
parent 5b07182020
commit 85f031c33a
8 changed files with 155 additions and 29 deletions
+3 -3
View File
@@ -5,11 +5,11 @@ module.exports = {
once: false,
async execute(channel, userstate, message, self) {
const db = mClient.db('channels')
const db = mClient.db('commands')
const coll = db.collection(channel)
const command = await coll.findOne({ name: 'donate' })
// create if not exists
// create in disabled state if not exists
if (!command) {
await coll.insertOne({
name: 'donate',
@@ -17,7 +17,7 @@ module.exports = {
})
}
if (!command.enabled){ return }
if (!command?.enabled){ return tClient.say(channel, `This command is currently disabled `)}
async function sendDonationAd() {
// Function to send static donate ad