accept discord token as env
we only really need that to function anyway, other things like jellyfin will just not do anything and we have default value for avatar reset.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
let config = {}
|
||||
try { config = require('../config.json'); }
|
||||
catch { config.jellyfin = null; }
|
||||
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const config = require('../config.json');
|
||||
const { createClient } = require('../lib/jellyfin');
|
||||
|
||||
async function sendChunked(interaction, content) {
|
||||
@@ -73,7 +76,10 @@ module.exports = {
|
||||
),
|
||||
|
||||
async execute(interaction) {
|
||||
if (!config.jellyfin.users.includes(interaction.user.id)) {
|
||||
if (!config.jellyfin) {
|
||||
interaction.reply({ content: 'This bot is not configured with a Jellyfin instance.', flags: 64 });
|
||||
return;
|
||||
} else if (!config.jellyfin.users.includes(interaction.user.id)) {
|
||||
interaction.reply({ content: 'You are not authorized to use this command.', flags: 64 });
|
||||
return;
|
||||
} else if (interaction.channel.type !== 1) {
|
||||
@@ -187,4 +193,4 @@ module.exports = {
|
||||
await interaction.editReply(`Error fetching from Jellyfin: ${err.message}`);
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user