Merge branch 'codetheweb:master' into master

This commit is contained in:
Oliver Traber 2023-03-07 20:47:54 +01:00 committed by GitHub
commit 2db3fd1c40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 108 additions and 45 deletions

View file

@ -0,0 +1,12 @@
import {Setting} from '@prisma/client';
import {prisma} from './db';
import {createGuildSettings} from '../events/guild-create';
export async function getGuildSettings(guildId: string): Promise<Setting> {
const config = await prisma.setting.findUnique({where: {guildId}});
if (!config) {
return createGuildSettings(guildId);
}
return config;
}