Replaced clang format with prettuier (sadly)

This commit is contained in:
2023-12-28 16:47:52 +01:00
parent ca5bbd0b81
commit 117140fe9d
99 changed files with 13519 additions and 12011 deletions

View File

@@ -9,34 +9,41 @@ const event: Event = {
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.")
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.")
console.log(
"[ERROR] The channel used for new join logging is not a text channel.",
)
return
}
channel.send({
embeds: [{
title: "New Member",
description: userMention(member.id) + " has joined the server.\n" +
"Account created: " + member.user.createdAt.toLocaleString(),
color: embedColor,
footer: {
text: "ID: " + member.id
embeds: [
{
title: "New Member",
description:
userMention(member.id) +
" has joined the server.\n" +
"Account created: " +
member.user.createdAt.toLocaleString(),
color: embedColor,
footer: {
text: "ID: " + member.id,
},
timestamp: new Date().toISOString(),
},
timestamp: new Date().toISOString()
}]
],
})
}
},
}
export = event
export = event

View File

@@ -10,25 +10,33 @@ const event: Event = {
execute(interaction: ChatInputCommandInteraction | ButtonInteraction) {
if (interaction.isCommand()) {
try {
console.log(interaction.user.username + " ran " +
interaction.commandName + " " +
interaction.options.getSubcommand()
console.log(
interaction.user.username +
" ran " +
interaction.commandName +
" " +
interaction.options.getSubcommand(),
)
} catch {
console.log(interaction.user.username + " ran " +
interaction.commandName
console.log(
interaction.user.username +
" ran " +
interaction.commandName,
)
}
}
if (interaction.isButton()) {
console.log(interaction.user.username + "#" +
interaction.user.discriminator + " clicked " +
interaction.customId
console.log(
interaction.user.username +
"#" +
interaction.user.discriminator +
" clicked " +
interaction.customId,
)
return
}
}
},
}
export = event
export = event

View File

@@ -8,10 +8,13 @@ const event: Event = {
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")
}
}
},
}
export = event
export = event

View File

@@ -9,7 +9,7 @@ const event: Event = {
execute(client: Client) {
console.log("Logged in as " + client.user!.tag + "!")
}
},
}
export = event
export = event

View File

@@ -16,7 +16,9 @@ const event: Event = {
const embedColor = Number(color.replace("#", "0x"))
if (!channel) {
console.log("[ERROR] Could not find channel used for online message.")
console.log(
"[ERROR] Could not find channel used for online message.",
)
return
}
@@ -26,12 +28,14 @@ const event: Event = {
}
channel.send({
embeds: [{
description: "Bot is online!",
color: embedColor
}]
embeds: [
{
description: "Bot is online!",
color: embedColor,
},
],
})
}
},
}
export = event
export = event

View File

@@ -9,7 +9,6 @@ const event: Event = {
event: "ready",
execute(client: Client) {
// Playing 0
// Streaming 1
// Listening 2
@@ -19,20 +18,16 @@ const event: Event = {
const user = client.user!
user.setActivity(
{ name: statuses[0].name, type: statuses[0].type }
)
user.setActivity({ name: statuses[0].name, type: statuses[0].type })
let i = 1
setInterval(() =>
user.setActivity(
statuses[i++ % statuses.length]
),
1000 * 60 * 10
setInterval(
() => user.setActivity(statuses[i++ % statuses.length]),
1000 * 60 * 10,
)
user.setStatus("dnd")
}
},
}
export = event
export = event

View File

@@ -1,4 +1,9 @@
import { userMention, channelMention, VoiceState, ChannelType } from "discord.js"
import {
userMention,
channelMention,
VoiceState,
ChannelType,
} from "discord.js"
import { botLogChannel, color } from "../../../../config/options.json"
import { Event } from "../../../interfaces"
@@ -8,21 +13,24 @@ const event: Event = {
type: "event",
event: "voiceStateUpdate",
execute(oldState: VoiceState, newState: VoiceState) {
if (process.env.NODE_ENV === 'dev') return
execute(oldState: VoiceState, newState: VoiceState) {
if (process.env.NODE_ENV === "dev") return
const guild = oldState.guild
const channel = guild.channels.cache.get(botLogChannel)
const embedColor = Number(color.replace("#", "0x"))
if (!channel) {
console.log("[ERROR] Could not find channel used for voice channel join/leave logging.")
console.log(
"[ERROR] Could not find channel used for voice channel join/leave logging.",
)
return
}
if (channel.type !== ChannelType.GuildText) {
console.log("[ERROR] The channel used for voice channel join/leave logging is not a text channel.")
console.log(
"[ERROR] The channel used for voice channel join/leave logging is not a text channel.",
)
return
}
@@ -30,60 +38,62 @@ const event: Event = {
const newChannel = newState.channel
if (oldChannel === null && newChannel !== null) {
channel.send({
embeds: [{
title: "Voice Channel Join",
description: userMention(newState.member!.id) +
" joined " +
channelMention(newChannel.id),
color: embedColor,
footer: {
text: "ID: " + newState.member!.id
embeds: [
{
title: "Voice Channel Join",
description:
userMention(newState.member!.id) +
" joined " +
channelMention(newChannel.id),
color: embedColor,
footer: {
text: "ID: " + newState.member!.id,
},
timestamp: new Date().toISOString(),
},
timestamp: new Date().toISOString()
}]
],
})
} else if (oldChannel !== null && newChannel === null) {
channel.send({
embeds: [{
title: "Voice Channel Leave",
description: userMention(oldState.member!.id) +
" left " +
channelMention(oldChannel.id),
color: embedColor,
footer: {
text: "ID: " + oldState.member!.id
embeds: [
{
title: "Voice Channel Leave",
description:
userMention(oldState.member!.id) +
" left " +
channelMention(oldChannel.id),
color: embedColor,
footer: {
text: "ID: " + oldState.member!.id,
},
timestamp: new Date().toISOString(),
},
timestamp: new Date().toISOString()
}]
],
})
} else if (oldChannel !== null && newChannel !== null) {
if (oldChannel.id === newChannel.id) return
channel.send({
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
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,
},
timestamp: new Date().toISOString(),
},
timestamp: new Date().toISOString()
}]
],
})
}
}
},
}
export = event
export = event