diff --git a/config/options.json b/config/options.json index 60d8035..21acc44 100644 --- a/config/options.json +++ b/config/options.json @@ -12,6 +12,7 @@ "guildLogChannel": "1183733282534326322", "errorLogChannel": "1192476369850994788", "moderationLogChannel": "1193329771795447818", + "devLogChannel": "1193688673632391280", "waitingListChannel": "1145773618291298384", "waitingListMessage": "1146027645415473193", "instructionsgif": "https://cdn.discordapp.com/attachments/838716950723952640/1188211176300089384/4DMu513uNxbM.gif?ex=6599b2e4&is=65873de4&hm=e727c7a39aacbc47d6a5453f4b5f792a45679983c30d662cd258a311381b6df0&" diff --git a/src/events/server/guildMemberAdd/logNewJoins.ts b/src/events/server/guildMemberAdd/logNewJoins.ts index f8b4da0..56b4ddb 100644 --- a/src/events/server/guildMemberAdd/logNewJoins.ts +++ b/src/events/server/guildMemberAdd/logNewJoins.ts @@ -10,6 +10,7 @@ export = { event: "guildMemberAdd", execute(member: GuildMember) { + if (process.env.NODE_ENV === "dev") return const embedColor = Number(color.replace("#", "0x")) logToChannel("bot", { diff --git a/src/utils/functions/logtochannel.ts b/src/utils/functions/logtochannel.ts index 4f186b4..d0e1068 100644 --- a/src/utils/functions/logtochannel.ts +++ b/src/utils/functions/logtochannel.ts @@ -1,4 +1,4 @@ -import { guildid, onlineLogChannel, botLogChannel, guildLogChannel, errorLogChannel, moderationLogChannel } from "../../../config/options.json" +import { guildid, onlineLogChannel, botLogChannel, guildLogChannel, errorLogChannel, moderationLogChannel, devLogChannel } from "../../../config/options.json" import { Guild, MessageCreateOptions, TextChannel } from "discord.js" import Illegitimate from "../Illegitimate" @@ -7,15 +7,22 @@ const channels = { bot: botLogChannel, guild: guildLogChannel, error: errorLogChannel, - mod: moderationLogChannel + mod: moderationLogChannel, + dev: devLogChannel } type Channel = keyof typeof channels export default async function logToChannel(channel: Channel, message: MessageCreateOptions): Promise { const guild = Illegitimate.client.guilds.cache.get(guildid) as Guild + let logChannel: TextChannel + + if (process.env.NODE_ENV === "dev") { + logChannel = guild.channels.cache.get(channels["dev"]) as TextChannel + } else { + logChannel = guild.channels.cache.get(channels[channel]) as TextChannel + } - const logChannel = guild.channels.cache.get(channels[channel]) as TextChannel if (!logChannel) { console.log(`[ERROR] Could not find channel used for ${channel} logging.`) return