Merge branch 'dev' into 'main'

Dev

See merge request illegitimate/illegitimate-bot!216
This commit is contained in:
2024-02-08 10:32:20 +00:00
12 changed files with 62 additions and 119 deletions

Binary file not shown.

View File

@@ -38,8 +38,8 @@
"devDependencies": {
"@types/ms": "^0.7.34",
"@types/node": "^20.11.16",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"concurrently": "^8.2.2",
"eslint": "^8.56.0",
"ts-node": "^10.9.2",

View File

@@ -1,7 +1,6 @@
import { ChannelType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
import { embedColor, devMessage } from "config/options"
import { Command } from "interfaces"
import setup from "./counting/setup"
import ban from "./counting/ban"
import unban from "./counting/unban"
@@ -15,18 +14,6 @@ export = {
data: new SlashCommandBuilder()
.setName("counting")
.setDescription("counting subcommands")
.addSubcommand(subcommand =>
subcommand
.setName("setup")
.setDescription("Setup counting channel")
.addChannelOption(option =>
option
.setName("channel")
.setDescription("The channel to setup counting in")
.setRequired(true)
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
)
)
.addSubcommand(subcommand =>
subcommand
.setName("ban")
@@ -55,11 +42,6 @@ export = {
async execute(interaction) {
const subcommand = interaction.options.getSubcommand()
if (subcommand === "setup") {
setup(interaction)
return
}
if (subcommand === "ban") {
ban(interaction)
return

View File

@@ -1,46 +0,0 @@
import { ChatInputCommandInteraction, TextChannel, channelMention } from "discord.js"
import settingsSchema from "schemas/settingsSchema"
import { embedColor, devMessage } from "config/options"
import mongoose from "mongoose"
export default async function setup(interaction: ChatInputCommandInteraction): Promise<void> {
await interaction.deferReply()
const channel = interaction.options.getChannel("channel") as TextChannel
if (await settingsSchema.findOne({ name: "counting" })) {
await settingsSchema.findOneAndUpdate(
{ name: "counting" },
{ name: "counting", channel: channel.id }
)
await interaction.editReply({
embeds: [{
description: "Counting channel has been updated to " + channelMention(channel.id),
color: embedColor,
footer: {
icon_url: interaction.guild!.iconURL() || undefined,
text: interaction.guild!.name + " | " + devMessage
}
}]
})
} else {
const counting = new settingsSchema({
_id: new mongoose.Types.ObjectId(),
name: "counting",
value: channel.id
})
await counting.save()
await interaction.editReply({
embeds: [{
description: "Counting channel has been set to " + channelMention(channel.id),
color: embedColor,
footer: {
icon_url: interaction.guild!.iconURL() || undefined,
text: interaction.guild!.name + " | " + devMessage
}
}]
})
}
}

View File

@@ -26,6 +26,7 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
)
)
}
delete require.cache[require.resolve(filePath)]
}
client.on(Events.InteractionCreate, async interaction => {

View File

@@ -26,6 +26,7 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
)
)
}
delete require.cache[require.resolve(filePath)]
}
client.on(Events.InteractionCreate, async interaction => {

View File

@@ -26,6 +26,7 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
)
)
}
delete require.cache[require.resolve(filePath)]
}
//! command handler

View File

@@ -26,6 +26,7 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
)
)
}
delete require.cache[require.resolve(filePath)]
}
//! context menu command handler

View File

@@ -20,5 +20,6 @@ export default function loadCronEvents() {
cron.time.dayOfWeek
new CronJob(time, cron.execute, cron.onComplete, cron.start, cron.timeZone).start()
delete require.cache[require.resolve(filePath)]
}
}

View File

@@ -14,6 +14,7 @@ export default function loadEvents(client: Client) {
if (!event.disabled) {
client.on(event.event, event.execute)
}
delete require.cache[require.resolve(eventPath)]
}
}
}

View File

@@ -26,6 +26,7 @@ export default function loadModalEvents(client: Client, ft: FileType) {
)
)
}
delete require.cache[require.resolve(filePath)]
}
client.on(Events.InteractionCreate, async interaction => {

104
yarn.lock
View File

@@ -389,15 +389,15 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/eslint-plugin@npm:^6.20.0":
version: 6.20.0
resolution: "@typescript-eslint/eslint-plugin@npm:6.20.0"
"@typescript-eslint/eslint-plugin@npm:^6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/eslint-plugin@npm:6.21.0"
dependencies:
"@eslint-community/regexpp": "npm:^4.5.1"
"@typescript-eslint/scope-manager": "npm:6.20.0"
"@typescript-eslint/type-utils": "npm:6.20.0"
"@typescript-eslint/utils": "npm:6.20.0"
"@typescript-eslint/visitor-keys": "npm:6.20.0"
"@typescript-eslint/scope-manager": "npm:6.21.0"
"@typescript-eslint/type-utils": "npm:6.21.0"
"@typescript-eslint/utils": "npm:6.21.0"
"@typescript-eslint/visitor-keys": "npm:6.21.0"
debug: "npm:^4.3.4"
graphemer: "npm:^1.4.0"
ignore: "npm:^5.2.4"
@@ -410,44 +410,44 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
checksum: 5020faac39be476de056342f58f2bf68bb788f230e2fa4a2e27ceab8a5187dc450beba7333b0aa741a43aeaff45a117558132953f9390b5eca4c2cc004fde716
checksum: f911a79ee64d642f814a3b6cdb0d324b5f45d9ef955c5033e78903f626b7239b4aa773e464a38c3e667519066169d983538f2bf8e5d00228af587c9d438fb344
languageName: node
linkType: hard
"@typescript-eslint/parser@npm:^6.20.0":
version: 6.20.0
resolution: "@typescript-eslint/parser@npm:6.20.0"
"@typescript-eslint/parser@npm:^6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/parser@npm:6.21.0"
dependencies:
"@typescript-eslint/scope-manager": "npm:6.20.0"
"@typescript-eslint/types": "npm:6.20.0"
"@typescript-eslint/typescript-estree": "npm:6.20.0"
"@typescript-eslint/visitor-keys": "npm:6.20.0"
"@typescript-eslint/scope-manager": "npm:6.21.0"
"@typescript-eslint/types": "npm:6.21.0"
"@typescript-eslint/typescript-estree": "npm:6.21.0"
"@typescript-eslint/visitor-keys": "npm:6.21.0"
debug: "npm:^4.3.4"
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
peerDependenciesMeta:
typescript:
optional: true
checksum: d84ad5e2282b1096c80dedb903c83ecc31eaf7be1aafcb14c18d9ec2d4a319f2fd1e5a9038b944d9f42c36c1c57add5e4292d4026ca7d3d5441d41286700d402
checksum: a8f99820679decd0d115c0af61903fb1de3b1b5bec412dc72b67670bf636de77ab07f2a68ee65d6da7976039bbf636907f9d5ca546db3f0b98a31ffbc225bc7d
languageName: node
linkType: hard
"@typescript-eslint/scope-manager@npm:6.20.0":
version: 6.20.0
resolution: "@typescript-eslint/scope-manager@npm:6.20.0"
"@typescript-eslint/scope-manager@npm:6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/scope-manager@npm:6.21.0"
dependencies:
"@typescript-eslint/types": "npm:6.20.0"
"@typescript-eslint/visitor-keys": "npm:6.20.0"
checksum: f6768ed2dcd2d1771d55ed567ff392a6569ffd683a26500067509dd41769f8838c43686460fe7337144f324fd063df33f5d5646d44e5df4998ceffb3ad1fb790
"@typescript-eslint/types": "npm:6.21.0"
"@typescript-eslint/visitor-keys": "npm:6.21.0"
checksum: eaf868938d811cbbea33e97e44ba7050d2b6892202cea6a9622c486b85ab1cf801979edf78036179a8ba4ac26f1dfdf7fcc83a68c1ff66be0b3a8e9a9989b526
languageName: node
linkType: hard
"@typescript-eslint/type-utils@npm:6.20.0":
version: 6.20.0
resolution: "@typescript-eslint/type-utils@npm:6.20.0"
"@typescript-eslint/type-utils@npm:6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/type-utils@npm:6.21.0"
dependencies:
"@typescript-eslint/typescript-estree": "npm:6.20.0"
"@typescript-eslint/utils": "npm:6.20.0"
"@typescript-eslint/typescript-estree": "npm:6.21.0"
"@typescript-eslint/utils": "npm:6.21.0"
debug: "npm:^4.3.4"
ts-api-utils: "npm:^1.0.1"
peerDependencies:
@@ -455,23 +455,23 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
checksum: 8f622fbb14268f1d00b2948f995b570f0ef82be02c12be41d90385290a56ea0dbd34d855d6a5aff100b57f3bdd300ff0c300f16c78f12d6064f7ae6e34fd71bf
checksum: 7409c97d1c4a4386b488962739c4f1b5b04dc60cf51f8cd88e6b12541f84d84c6b8b67e491a147a2c95f9ec486539bf4519fb9d418411aef6537b9c156468117
languageName: node
linkType: hard
"@typescript-eslint/types@npm:6.20.0":
version: 6.20.0
resolution: "@typescript-eslint/types@npm:6.20.0"
checksum: 37589003b0e06f83c1945e3748e91af85918cfd997766894642a08e6f355f611cfe11df4e7632dda96e3a9b3441406283fe834ab0906cf81ea97fd43ca2aebe3
"@typescript-eslint/types@npm:6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/types@npm:6.21.0"
checksum: 020631d3223bbcff8a0da3efbdf058220a8f48a3de221563996ad1dcc30d6c08dadc3f7608cc08830d21c0d565efd2db19b557b9528921c78aabb605eef2d74d
languageName: node
linkType: hard
"@typescript-eslint/typescript-estree@npm:6.20.0":
version: 6.20.0
resolution: "@typescript-eslint/typescript-estree@npm:6.20.0"
"@typescript-eslint/typescript-estree@npm:6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/typescript-estree@npm:6.21.0"
dependencies:
"@typescript-eslint/types": "npm:6.20.0"
"@typescript-eslint/visitor-keys": "npm:6.20.0"
"@typescript-eslint/types": "npm:6.21.0"
"@typescript-eslint/visitor-keys": "npm:6.21.0"
debug: "npm:^4.3.4"
globby: "npm:^11.1.0"
is-glob: "npm:^4.0.3"
@@ -481,34 +481,34 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
checksum: 551f13445a303882d9fc0fbe14ef8507eb8414253fd87a5f13d2e324b5280b626421a238b8ec038e628bc80128dc06c057757f668738e82e64d5b39a9083c27d
checksum: af1438c60f080045ebb330155a8c9bb90db345d5069cdd5d01b67de502abb7449d6c75500519df829f913a6b3f490ade3e8215279b6bdc63d0fb0ae61034df5f
languageName: node
linkType: hard
"@typescript-eslint/utils@npm:6.20.0":
version: 6.20.0
resolution: "@typescript-eslint/utils@npm:6.20.0"
"@typescript-eslint/utils@npm:6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/utils@npm:6.21.0"
dependencies:
"@eslint-community/eslint-utils": "npm:^4.4.0"
"@types/json-schema": "npm:^7.0.12"
"@types/semver": "npm:^7.5.0"
"@typescript-eslint/scope-manager": "npm:6.20.0"
"@typescript-eslint/types": "npm:6.20.0"
"@typescript-eslint/typescript-estree": "npm:6.20.0"
"@typescript-eslint/scope-manager": "npm:6.21.0"
"@typescript-eslint/types": "npm:6.21.0"
"@typescript-eslint/typescript-estree": "npm:6.21.0"
semver: "npm:^7.5.4"
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
checksum: 0a8ede3d80a365b52ae96d88e4a9f6e6abf3569c6b60ff9f42ff900cd843ae7c5493cd95f8f2029d90bb0acbf31030980206af98e581d760d6d41e0f80e9fb86
checksum: ab2df3833b2582d4e5467a484d08942b4f2f7208f8e09d67de510008eb8001a9b7460f2f9ba11c12086fd3cdcac0c626761c7995c2c6b5657d5fa6b82030a32d
languageName: node
linkType: hard
"@typescript-eslint/visitor-keys@npm:6.20.0":
version: 6.20.0
resolution: "@typescript-eslint/visitor-keys@npm:6.20.0"
"@typescript-eslint/visitor-keys@npm:6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/visitor-keys@npm:6.21.0"
dependencies:
"@typescript-eslint/types": "npm:6.20.0"
"@typescript-eslint/types": "npm:6.21.0"
eslint-visitor-keys: "npm:^3.4.1"
checksum: 852d938f2e5d57200cf62733b42e73a369f797b097d17e8fd3fffd0f7315c3b9e1863eed60bb8d57d6535a3b7f1980f645f96ec6d513950f182bfa8107b33fab
checksum: 7395f69739cfa1cb83c1fb2fad30afa2a814756367302fb4facd5893eff66abc807e8d8f63eba94ed3b0fe0c1c996ac9a1680bcbf0f83717acedc3f2bb724fbf
languageName: node
linkType: hard
@@ -1213,8 +1213,8 @@ __metadata:
dependencies:
"@types/ms": "npm:^0.7.34"
"@types/node": "npm:^20.11.16"
"@typescript-eslint/eslint-plugin": "npm:^6.20.0"
"@typescript-eslint/parser": "npm:^6.20.0"
"@typescript-eslint/eslint-plugin": "npm:^6.21.0"
"@typescript-eslint/parser": "npm:^6.21.0"
axios: "npm:^1.6.7"
chalk: "npm:^4.1.2"
concurrently: "npm:^8.2.2"