Fixed formatting for event files

This commit is contained in:
2024-01-20 20:56:08 +01:00
parent 5ce69eced3
commit 1ffcaf602d
7 changed files with 94 additions and 163 deletions

View File

@@ -13,25 +13,20 @@ export = {
const embedColor = Number(color.replace("#", "0x"))
logToChannel("bot", {
embeds: [
{
title: "New Member",
description:
userMention(member.id) +
" has joined the server.\n" +
"Account created: " +
member.user.createdAt.toLocaleString(),
color: embedColor,
thumbnail: {
url: member.user.avatarURL() || ""
},
footer: {
text: "ID: " + member.id,
icon_url: member.user.avatarURL() || undefined
},
timestamp: new Date().toISOString()
}
]
embeds: [{
title: "New Member",
description: userMention(member.id) + " has joined the server.\n" +
"Account created: " + member.user.createdAt.toLocaleString(),
color: embedColor,
thumbnail: {
url: member.user.avatarURL() || ""
},
footer: {
text: "ID: " + member.id,
icon_url: member.user.avatarURL() || undefined
},
timestamp: new Date().toISOString()
}]
})
}
} as Event

View File

@@ -12,20 +12,16 @@ export = {
try {
console.log(
color(
interaction.user.username +
" ran " +
interaction.commandName +
" " +
interaction.options.getSubcommand(),
"pink"
interaction.user.username + " ran " +
interaction.commandName + " " +
interaction.options.getSubcommand(), "pink"
)
)
} catch {
console.log(
color(
interaction.user.username +
" ran " +
interaction.commandName,
interaction.user.username + " ran " +
interaction.commandName,
"pink"
)
)
@@ -35,11 +31,9 @@ export = {
if (interaction.isButton()) {
console.log(
color(
interaction.user.username +
"#" +
interaction.user.discriminator +
" clicked " +
interaction.customId,
interaction.user.username + "#" +
interaction.user.discriminator + " clicked " +
interaction.customId,
"pink"
)
)

View File

@@ -19,19 +19,15 @@ export = {
const output = eval(code)
const outputString = String(output)
await message.channel.send({
embeds: [
{
description: `\`\`\`js\n${outputString}\`\`\``
}
]
embeds: [{
description: `\`\`\`js\n${outputString}\`\`\``
}]
})
} catch (error) {
await message.channel.send({
embeds: [
{
description: `\`\`\`js\n${error}\`\`\``
}
]
embeds: [{
description: `\`\`\`js\n${error}\`\`\``
}]
})
}
}

View File

@@ -7,10 +7,7 @@ export = {
event: "messageCreate",
async execute(message: Message) {
if (
message.content.toLowerCase().includes("ur mom") &&
message.author.username === "taken.lua"
) {
if (message.content.toLowerCase().includes("ur mom") && message.author.username === "taken.lua") {
message.react("Woot:734345936347725885")
}
}

View File

@@ -13,12 +13,10 @@ export = {
const embedColor = Number(color.replace("#", "0x"))
logToChannel("online", {
embeds: [
{
description: "Bot is online!",
color: embedColor
}
]
embeds: [{
description: "Bot is online!",
color: embedColor
}]
})
}
} as Event

View File

@@ -17,64 +17,45 @@ export = {
if (oldChannel === null && newChannel !== null) {
logToChannel("bot", {
embeds: [
{
title: "Voice Channel Join",
description:
userMention(newState.member!.id) +
" joined " +
channelMention(newChannel.id),
color: embedColor,
footer: {
text: "ID: " + newState.member!.id,
icon_url:
newState.member!.user.avatarURL() || undefined
},
timestamp: new Date().toISOString()
}
]
embeds: [{
title: "Voice Channel Join",
description: userMention(newState.member!.id) + " joined " + channelMention(newChannel.id),
color: embedColor,
footer: {
text: "ID: " + newState.member!.id,
icon_url: newState.member!.user.avatarURL() || undefined
},
timestamp: new Date().toISOString()
}]
})
} else if (oldChannel !== null && newChannel === null) {
logToChannel("bot", {
embeds: [
{
title: "Voice Channel Leave",
description:
userMention(oldState.member!.id) +
" left " +
channelMention(oldChannel.id),
color: embedColor,
footer: {
text: "ID: " + oldState.member!.id,
icon_url:
oldState.member!.user.avatarURL() || undefined
},
timestamp: new Date().toISOString()
}
]
embeds: [{
title: "Voice Channel Leave",
description: userMention(oldState.member!.id) + " left " + channelMention(oldChannel.id),
color: embedColor,
footer: {
text: "ID: " + oldState.member!.id,
icon_url: oldState.member!.user.avatarURL() || undefined
},
timestamp: new Date().toISOString()
}]
})
} else if (oldChannel !== null && newChannel !== null) {
if (oldChannel.id === newChannel.id) return
logToChannel("bot", {
embeds: [
{
title: "Voice Channel Switch",
description:
userMention(oldState.member!.id) +
" switched from " +
channelMention(oldChannel.id) +
" to " +
channelMention(newChannel.id),
color: embedColor,
footer: {
text: "ID: " + oldState.member!.id,
icon_url:
oldState.member!.user.avatarURL() || undefined
},
timestamp: new Date().toISOString()
}
]
embeds: [{
title: "Voice Channel Switch",
description: userMention(oldState.member!.id) + " switched from " + channelMention(oldChannel.id) +
" to " + channelMention(newChannel.id),
color: embedColor,
footer: {
text: "ID: " + oldState.member!.id,
icon_url: oldState.member!.user.avatarURL() || undefined
},
timestamp: new Date().toISOString()
}]
})
}
}