swapped to a new db locally hosted
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const { readDb } = require('../../backend/db.js');
|
||||
const api = require('../api');
|
||||
|
||||
module.exports = {
|
||||
name: 'view-autorole',
|
||||
@@ -9,10 +9,9 @@ module.exports = {
|
||||
.setName('view-autorole')
|
||||
.setDescription('View the current autorole configuration for this server.'),
|
||||
async execute(interaction) {
|
||||
const db = readDb();
|
||||
const guildId = interaction.guildId;
|
||||
const settings = db[guildId] || {};
|
||||
const autorole = settings.autorole || { enabled: false, roleId: '' };
|
||||
const guildId = interaction.guildId;
|
||||
const settings = (await api.getServerSettings(guildId)) || {};
|
||||
const autorole = settings.autorole || { enabled: false, roleId: '' };
|
||||
|
||||
if (!autorole.enabled) {
|
||||
await interaction.reply({ content: 'Autorole is currently disabled for this server.', flags: 64 });
|
||||
|
||||
Reference in New Issue
Block a user