🎨 getEmbedConfig
This commit is contained in:
parent
827678dfcf
commit
f56f33e215
1 changed files with 6 additions and 8 deletions
|
@ -3,18 +3,16 @@ import * as embedConfig from "../../config/embed";
|
|||
|
||||
import { Guild } from "discord.js";
|
||||
|
||||
export default async (guild: Guild | null) => {
|
||||
if (guild == null)
|
||||
return {
|
||||
...embedConfig,
|
||||
};
|
||||
export default async (guild?: Guild | null) => {
|
||||
if (!guild) {
|
||||
return { ...embedConfig };
|
||||
}
|
||||
|
||||
const guildConfig = await guildSchema.findOne({ guildId: guild.id });
|
||||
|
||||
if (guildConfig == null)
|
||||
if (!guildConfig) {
|
||||
return {
|
||||
...embedConfig,
|
||||
};
|
||||
|
||||
}
|
||||
return guildConfig.embeds;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue