Skip to content

Commit

Permalink
fix: Ensure guild settings exist in DB before updating (museofficial#999
Browse files Browse the repository at this point in the history
)
  • Loading branch information
FoxxMD authored Feb 17, 2024
1 parent aba622c commit 1d5729f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"migrations:generate": "npm run prisma:with-env migrate dev",
"migrations:run": "npm run prisma:with-env migrate deploy",
"prisma:with-env": "npm run env:set-database-url prisma",
"prisma:generate": "prisma generate",
"env:set-database-url": "tsx src/scripts/run-with-database-url.ts",
"release": "release-it",
"build": "tsc"
Expand Down
3 changes: 3 additions & 0 deletions src/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export default class implements Command {
.setDescription('show all settings'));

async execute(interaction: ChatInputCommandInteraction) {
// Ensure guild settings exist before trying to update
await getGuildSettings(interaction.guild!.id);

switch (interaction.options.getSubcommand()) {
case 'set-playlist-limit': {
const limit: number = interaction.options.getInteger('limit')!;
Expand Down

0 comments on commit 1d5729f

Please sign in to comment.