mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-06-27 09:12:43 +02:00
Create guild settings if not found (#911)
Co-authored-by: Max Isom <codetheweb@users.noreply.github.com>
This commit is contained in:
parent
6926e39c56
commit
02ee8aefc8
7 changed files with 25 additions and 27 deletions
|
@ -3,6 +3,7 @@ import {ChatInputCommandInteraction, EmbedBuilder, PermissionFlagsBits} from 'di
|
|||
import {injectable} from 'inversify';
|
||||
import {prisma} from '../utils/db.js';
|
||||
import Command from './index.js';
|
||||
import {getGuildSettings} from '../utils/get-guild-settings';
|
||||
|
||||
@injectable()
|
||||
export default class implements Command {
|
||||
|
@ -96,11 +97,7 @@ export default class implements Command {
|
|||
case 'get': {
|
||||
const embed = new EmbedBuilder().setTitle('Config');
|
||||
|
||||
const config = await prisma.setting.findUnique({where: {guildId: interaction.guild!.id}});
|
||||
|
||||
if (!config) {
|
||||
throw new Error('no config found');
|
||||
}
|
||||
const config = await getGuildSettings(interaction.guild!.id);
|
||||
|
||||
const settingsToShow = {
|
||||
'Playlist Limit': config.playlistLimit,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue