Merge branch 'dev' into 'main'

Dev

See merge request illegitimate/illegitimate-bot!268
This commit is contained in:
2024-08-24 21:06:04 +00:00
14 changed files with 165 additions and 157 deletions

View File

@@ -16,9 +16,12 @@ const compat = new FlatCompat({
allConfig: js.configs.all
})
export default [{
ignores: ["**/node_modules", "**/dist"],
}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), {
export default [
{
ignores: ["**/node_modules", "**/dist"]
},
...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"),
{
plugins: {
"@typescript-eslint": typescriptEslint,
},
@@ -79,8 +82,14 @@ export default [{
}],
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/ban-ts-comment": ["error", {
"ts-expect-error": "allow-with-description",
"ts-ignore": "allow-with-description",
"ts-nocheck": "allow-with-description",
"ts-check": "allow-with-description",
}],
},
}, {
}, {
languageOptions: {
globals: {
...globals.node,
@@ -89,4 +98,5 @@ export default [{
ecmaVersion: 5,
sourceType: "commonjs",
},
}]
}
]

View File

@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/nodemon.json",
"restartable": "rs",
"ignore": [
".git",

View File

@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/nodemon.json",
"ignore": [
".git",
"node_modules",

View File

@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/nodemon.json",
"restartable": "rs",
"ignore": [
".git",

View File

@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "illegitimate-bot",
"displayName": "Illegitimate Bot",
"version": "1.0.0",

View File

@@ -15,8 +15,7 @@ export default async function loadAutocompleteEvents(client: Client, ft: FileTyp
for (const file of autocompleteFiles) {
const filePath = path.join(autocompletePath, file)
const { default: autocompleteImport } = await import("file://" + filePath)
const autocomplete: IAutocomplete = autocompleteImport
const { default: autocomplete } = await import("file://" + filePath) as { default: IAutocomplete }
if ("name" in autocomplete && "execute" in autocomplete) {
client.autocomplete.set(autocomplete.name, autocomplete)

View File

@@ -15,8 +15,7 @@ export default async function loadButtonEvents(client: Client, ft: FileType) {
for (const file of btnFiles) {
const filePath = path.join(btnPath, file)
const { default: btnImport } = await import("file://" + filePath)
const btn: IButton = btnImport
const { default: btn } = await import("file://" + filePath) as { default: IButton }
if ("name" in btn && "execute" in btn) {
client.buttons.set(btn.name, btn)

View File

@@ -15,8 +15,7 @@ export default async function loadSlashCommandsEvents(client: Client, ft: FileTy
for (const file of cmdFiles) {
const filePath = path.join(cmdPath, file)
const { default: cmdImport } = await import("file://" + filePath)
const cmd: ICommand = cmdImport
const { default: cmd } = await import("file://" + filePath) as { default: ICommand }
if ("data" in cmd && "execute" in cmd) {
client.commands.set(cmd.data.name, cmd)

View File

@@ -15,8 +15,7 @@ export default async function loadContextMenuEvents(client: Client, ft: FileType
for (const file of contextMenuFiles) {
const filePath = path.join(contextMenuPath, file)
const { default: cmdImport } = await import("file://" + filePath)
const cmd: IContextMenu = cmdImport
const { default: cmd } = await import("file://" + filePath) as { default: IContextMenu }
if ("data" in cmd && "execute" in cmd) {
client.contextmenus.set(cmd.data.name, cmd)

View File

@@ -10,8 +10,7 @@ export default async function loadCronEvents() {
for (const file of cronFiles) {
const filePath = path.join(cronPath, file)
const { default: cronImport } = await import("file://" + filePath)
const cron: ICron = cronImport
const { default: cron } = await import("file://" + filePath) as { default: ICron }
const time =
cron.time.seconds + " " +

View File

@@ -11,8 +11,7 @@ export default async function loadEvents(client: Client) {
const eventFiles = fs.readdirSync(path.join(serverDir, eventDir))
for (const eventFile of eventFiles) {
const eventPath = path.join(serverDir, eventDir, eventFile)
const { default: eventImport } = await import("file://" + eventPath)
const event: IEvent = eventImport
const { default: event } = await import("file://" + eventPath) as { default: IEvent }
if (!event.disabled) {
client.on(event.event, event.execute)
}

View File

@@ -15,8 +15,7 @@ export default async function loadModalEvents(client: Client, ft: FileType) {
for (const file of modalFiles) {
const filePath = path.join(modalPath, file)
const { default: modalImport } = await import("file://" + filePath)
const modal: IModal = modalImport
const { default: modal } = await import("file://" + filePath) as { default: IModal }
if ("name" in modal && "execute" in modal) {
client.modals.set(modal.name, modal)

View File

@@ -44,11 +44,11 @@ class Illegitimate {
redis.on("ready", () => {
console.log(color("Connected to Redis", "green"))
})
// if (process.env.NODE_ENV === "dev") {
// sequelize.sync().then(() => {
// console.log(color("Synced the db [dev]", "green"))
// })
// }
if (process.env.NODE_ENV === "dev") {
sequelize.sync().then(() => {
console.log(color("Synced the db [dev]", "green"))
})
}
// connect(env.prod.mongoURI!, {}).then(() => {
// console.log(color("Connected to MongoDB", "green"))
// })

View File

@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",