🐛 Default embed if guild is null #337
This commit is contained in:
parent
604e3a19a7
commit
50f070787c
1 changed files with 9 additions and 7 deletions
|
@ -1,17 +1,19 @@
|
|||
import guildSchema from "@schemas/guild";
|
||||
import * as embedConfig from "@config/embed";
|
||||
|
||||
import { ColorResolvable, Guild } from "discord.js";
|
||||
import { Guild } from "discord.js";
|
||||
|
||||
export default async (guild: Guild | null) => {
|
||||
if (guild == null)
|
||||
return {
|
||||
...embedConfig,
|
||||
};
|
||||
|
||||
export default async (guild: Guild) => {
|
||||
const guildConfig = await guildSchema.findOne({ guildId: guild.id });
|
||||
|
||||
if (guildConfig == null)
|
||||
return {
|
||||
successColor: "#22bb33" as ColorResolvable,
|
||||
waitColor: "#f0ad4e" as ColorResolvable,
|
||||
errorColor: "#bb2124" as ColorResolvable,
|
||||
footerIcon: "https://github.com/ZynerOrg.png",
|
||||
footerText: "https://github.com/ZynerOrg/xyter",
|
||||
...embedConfig,
|
||||
};
|
||||
|
||||
return guildConfig.embeds;
|
||||
|
|
Loading…
Add table
Reference in a new issue