ui changes
This commit is contained in:
@@ -1,23 +1,16 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { readDb } = require('../../backend/db.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'ping',
|
||||
description: 'Replies with Pong!',
|
||||
execute(interaction) {
|
||||
fs.readFile(path.join(__dirname, '../../backend/db.json'), 'utf8', (err, data) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return interaction.reply('An error occurred.');
|
||||
}
|
||||
const db = JSON.parse(data);
|
||||
const settings = db[interaction.guildId] || { pingCommand: false };
|
||||
const db = readDb();
|
||||
const settings = db[interaction.guildId] || { pingCommand: false };
|
||||
|
||||
if (settings.pingCommand) {
|
||||
interaction.reply('Pong!');
|
||||
} else {
|
||||
interaction.reply('The ping command is disabled on this server.');
|
||||
}
|
||||
});
|
||||
if (settings.pingCommand) {
|
||||
interaction.reply('Pong!');
|
||||
} else {
|
||||
interaction.reply('The ping command is disabled on this server.');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user