Merge branch 'dev' into 'main'
Small tweak See merge request illegitimate/illegitimate-bot!170
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
"guildLogChannel": "1183733282534326322",
|
"guildLogChannel": "1183733282534326322",
|
||||||
"errorLogChannel": "1192476369850994788",
|
"errorLogChannel": "1192476369850994788",
|
||||||
"moderationLogChannel": "1193329771795447818",
|
"moderationLogChannel": "1193329771795447818",
|
||||||
|
"devLogChannel": "1193688673632391280",
|
||||||
"waitingListChannel": "1145773618291298384",
|
"waitingListChannel": "1145773618291298384",
|
||||||
"waitingListMessage": "1146027645415473193",
|
"waitingListMessage": "1146027645415473193",
|
||||||
"instructionsgif": "https://cdn.discordapp.com/attachments/838716950723952640/1188211176300089384/4DMu513uNxbM.gif?ex=6599b2e4&is=65873de4&hm=e727c7a39aacbc47d6a5453f4b5f792a45679983c30d662cd258a311381b6df0&"
|
"instructionsgif": "https://cdn.discordapp.com/attachments/838716950723952640/1188211176300089384/4DMu513uNxbM.gif?ex=6599b2e4&is=65873de4&hm=e727c7a39aacbc47d6a5453f4b5f792a45679983c30d662cd258a311381b6df0&"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export = {
|
|||||||
event: "guildMemberAdd",
|
event: "guildMemberAdd",
|
||||||
|
|
||||||
execute(member: GuildMember) {
|
execute(member: GuildMember) {
|
||||||
|
if (process.env.NODE_ENV === "dev") return
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
logToChannel("bot", {
|
logToChannel("bot", {
|
||||||
|
|||||||
@@ -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 { Guild, MessageCreateOptions, TextChannel } from "discord.js"
|
||||||
import Illegitimate from "../Illegitimate"
|
import Illegitimate from "../Illegitimate"
|
||||||
|
|
||||||
@@ -7,15 +7,22 @@ const channels = {
|
|||||||
bot: botLogChannel,
|
bot: botLogChannel,
|
||||||
guild: guildLogChannel,
|
guild: guildLogChannel,
|
||||||
error: errorLogChannel,
|
error: errorLogChannel,
|
||||||
mod: moderationLogChannel
|
mod: moderationLogChannel,
|
||||||
|
dev: devLogChannel
|
||||||
}
|
}
|
||||||
|
|
||||||
type Channel = keyof typeof channels
|
type Channel = keyof typeof channels
|
||||||
|
|
||||||
export default async function logToChannel(channel: Channel, message: MessageCreateOptions): Promise<void|null> {
|
export default async function logToChannel(channel: Channel, message: MessageCreateOptions): Promise<void|null> {
|
||||||
const guild = Illegitimate.client.guilds.cache.get(guildid) as Guild
|
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) {
|
if (!logChannel) {
|
||||||
console.log(`[ERROR] Could not find channel used for ${channel} logging.`)
|
console.log(`[ERROR] Could not find channel used for ${channel} logging.`)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user