Updated imports and formating

Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
2024-01-16 17:05:15 +01:00
parent ee0250ed5e
commit 5661bc66bb
49 changed files with 819 additions and 491 deletions

View File

@@ -1,4 +1,12 @@
import { guildid, onlineLogChannel, botLogChannel, guildLogChannel, errorLogChannel, moderationLogChannel, devLogChannel } 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 "utils/Illegitimate"
@@ -8,12 +16,15 @@ const channels = {
guild: guildLogChannel,
error: errorLogChannel,
mod: moderationLogChannel,
dev: devLogChannel
dev: devLogChannel,
}
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
let logChannel: TextChannel
@@ -24,9 +35,11 @@ export default async function logToChannel(channel: Channel, message: MessageCre
}
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
}
await logChannel.send(message)
}
}