Updated imports and formating
Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
@@ -4,7 +4,7 @@ const colors = {
|
||||
red: "#f38ba8",
|
||||
lavender: "#b4befe",
|
||||
green: "#a6e3a1",
|
||||
pink: "#f5c2e7"
|
||||
pink: "#f5c2e7",
|
||||
}
|
||||
|
||||
export default function color(text: string, type: keyof typeof colors) {
|
||||
@@ -41,4 +41,4 @@ export default function color(text: string, type: keyof typeof colors) {
|
||||
|
||||
export default function colorize(text: string, color: keyof typeof colors) {
|
||||
return colors[color] + text + colors.reset
|
||||
} */
|
||||
} */
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
member,
|
||||
guildStaff,
|
||||
guildRole,
|
||||
defaultMember
|
||||
defaultMember,
|
||||
} from "config/roles.json"
|
||||
const roles = [
|
||||
gm,
|
||||
|
||||
Reference in New Issue
Block a user