Converted main codebase to typescript

Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
2023-12-28 13:17:57 +01:00
parent 1d9ded82a4
commit 68fde04bbb
122 changed files with 14230 additions and 1834 deletions

View File

@@ -1,14 +1,14 @@
const { userMention } = require("discord.js")
const { color, botLogChannel } = require("../../../../config/options.json")
import { ChannelType, GuildMember, userMention } from "discord.js"
import { color, botLogChannel } from "../../../../config/options.json"
import { Event } from "../../../interfaces"
module.exports = {
const event: Event = {
name: "logNewJoins",
description: "Logs new joins",
type: "event",
event: "guildMemberAdd",
/** @param { import('discord.js').GuildMember } member */
execute(member) {
execute(member: GuildMember) {
const channel = member.guild.channels.cache.get(botLogChannel)
const embedColor = Number(color.replace("#", "0x"))
@@ -18,6 +18,11 @@ module.exports = {
return
}
if (channel.type !== ChannelType.GuildText) {
console.log("[ERROR] The channel used for new join logging is not a text channel.")
return
}
channel.send({
embeds: [{
title: "New Member",
@@ -27,9 +32,11 @@ module.exports = {
footer: {
text: "ID: " + member.id
},
timestamp: new Date()
timestamp: new Date().toISOString()
}]
})
}
}
export = event