diff --git a/src/events/a.getGuildConf.ts b/src/events/a.getGuildConf.ts index c3ea253..1fe8113 100644 --- a/src/events/a.getGuildConf.ts +++ b/src/events/a.getGuildConf.ts @@ -14,13 +14,7 @@ export async function getGuildAuditLoggingChannel(guild: Guild) { } export async function getGuildGreetingData(guild: Guild) { - const config = await getGuildConfig(guild); - if ( - config.greetings?.channel || - (!config.greetings?.goodbyeEnabled && !config.greetings?.welcomeEnabled) - ) - return; - return config.greetings; + return (await getGuildConfig(guild)).greetings; } async function getGuildConfig(guild: Guild) { diff --git a/src/events/guildMemberAdd.ts b/src/events/guildMemberAdd.ts index 24f390d..0cb4e2d 100644 --- a/src/events/guildMemberAdd.ts +++ b/src/events/guildMemberAdd.ts @@ -1,9 +1,8 @@ import { + BaseGuildTextChannel, EmbedBuilder, Events, GuildMember, - NewsChannel, - TextChannel, userMention } from 'discord.js'; import { getGuildGreetingData } from './a.getGuildConf'; @@ -14,10 +13,9 @@ export const execute = async (member: GuildMember) => { const config = await getGuildGreetingData(member.guild); if (!config?.welcomeEnabled) return; await ( - (await member.guild.channels.fetch(config.channel)) as - | NewsChannel - | TextChannel - | undefined + (await member.guild.channels.fetch( + config.channel + )) as BaseGuildTextChannel | null )?.send({ embeds: [ new EmbedBuilder()