Added logtochannel function and moved to it
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ChannelType, GuildMember, userMention } from "discord.js"
|
||||
import { color, botLogChannel } from "../../../../config/options.json"
|
||||
import { GuildMember, userMention } from "discord.js"
|
||||
import { color } from "../../../../config/options.json"
|
||||
import { Event } from "../../../interfaces"
|
||||
import logToChannel from "../../../utils/functions/logtochannel"
|
||||
|
||||
export = {
|
||||
name: "logNewJoins",
|
||||
@@ -9,24 +10,9 @@ export = {
|
||||
event: "guildMemberAdd",
|
||||
|
||||
execute(member: GuildMember) {
|
||||
const channel = member.guild.channels.cache.get(botLogChannel)
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
if (!channel) {
|
||||
console.log(
|
||||
"[ERROR] Could not find channel used for new join logging.",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if (channel.type !== ChannelType.GuildText) {
|
||||
console.log(
|
||||
"[ERROR] The channel used for new join logging is not a text channel.",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
channel.send({
|
||||
logToChannel("bot", {
|
||||
embeds: [
|
||||
{
|
||||
title: "New Member",
|
||||
|
||||
Reference in New Issue
Block a user