From 438c38df115659672c055d92595d869ba70512bc Mon Sep 17 00:00:00 2001 From: Taken Date: Fri, 15 Mar 2024 16:52:07 +0100 Subject: [PATCH 1/5] Limited the track titile --- src/components/autocomplete/music.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/autocomplete/music.ts b/src/components/autocomplete/music.ts index e0692a3..a3a975d 100644 --- a/src/components/autocomplete/music.ts +++ b/src/components/autocomplete/music.ts @@ -23,10 +23,10 @@ export = { }) const results = tracks.map(track => ({ - name: `${track.title} [${track.author}]`, + name: `${track.title.slice(0, 20)} [${track.author}]`, value: track.url })) - await interaction.respond(results.slice(0, 10)).catch() + await interaction.respond(results.slice(0, 6)).catch() } } as IAutocomplete \ No newline at end of file From f53239a84509362f27247cba3ee9cef0495b0ba4 Mon Sep 17 00:00:00 2001 From: Taken Date: Fri, 15 Mar 2024 16:58:08 +0100 Subject: [PATCH 2/5] Added cross env --- package.json | 5 +++-- yarn.lock | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 127d294..96faf96 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,11 @@ "dev": "conc --names \"TSC,BOT\" --prefix-colors \"blue, magenta\" \"tsc -w\" \"yarn dev:js\"", "dev:ts": "nodemon --config nodemon.json src/index.ts", "dev:js": "nodemon --config nodemon-js.json dist/index.js", - "dev:build": "ts-node scripts/dev-deploy.ts", + "dev:build": "cross-env NODE_PATH=src/ \"ts-node scripts/dev-deploy.ts\"", "dev:delete": "ts-node scripts/delete-commands.ts", "lint": "eslint src", "lint:fix": "eslint --fix src", - "prod:build": "ts-node scripts/deploy-commands.ts" + "prod:build": "cross-env NODE_PATH=src/ \"ts-node scripts/deploy-commands.ts\"" }, "author": "Taken", "license": "GPL-3.0-only", @@ -46,6 +46,7 @@ "@typescript-eslint/eslint-plugin": "^7.0.2", "@typescript-eslint/parser": "^7.0.2", "concurrently": "^8.2.2", + "cross-env": "^7.0.3", "eslint": "^8.56.0", "ts-node": "^10.9.2", "typescript": "^5.3.3" diff --git a/yarn.lock b/yarn.lock index 237c097..8b891d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -840,7 +840,19 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.2": +"cross-env@npm:^7.0.3": + version: 7.0.3 + resolution: "cross-env@npm:7.0.3" + dependencies: + cross-spawn: "npm:^7.0.1" + bin: + cross-env: src/bin/cross-env.js + cross-env-shell: src/bin/cross-env-shell.js + checksum: 10c0/f3765c25746c69fcca369655c442c6c886e54ccf3ab8c16847d5ad0e91e2f337d36eedc6599c1227904bf2a228d721e690324446876115bc8e7b32a866735ecf + languageName: node + linkType: hard + +"cross-spawn@npm:^7.0.1, cross-spawn@npm:^7.0.2": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" dependencies: @@ -1471,6 +1483,7 @@ __metadata: chalk: "npm:^4.1.2" concurrently: "npm:^8.2.2" cron: "npm:^3.1.6" + cross-env: "npm:^7.0.3" discord-player: "npm:^6.6.7" discord.js: "npm:^14.14.1" dotenv: "npm:^16.4.5" From ffa2627f8108919cda6d24d73baa8a0db4a78d37 Mon Sep 17 00:00:00 2001 From: Taken Date: Fri, 15 Mar 2024 17:00:20 +0100 Subject: [PATCH 3/5] Updated deps --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 96faf96..f2f72a3 100644 --- a/package.json +++ b/package.json @@ -35,21 +35,21 @@ "discord.js": "^14.14.1", "dotenv": "^16.4.5", "ioredis": "^5.3.2", - "mongoose": "^8.1.3", + "mongoose": "^8.2.1", "ms": "^2.1.3", "pretty-ms": "^9.0.0", "youtube-ext": "^1.1.16" }, "devDependencies": { "@types/ms": "^0.7.34", - "@types/node": "^20.11.19", - "@typescript-eslint/eslint-plugin": "^7.0.2", - "@typescript-eslint/parser": "^7.0.2", + "@types/node": "^20.11.28", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", "concurrently": "^8.2.2", "cross-env": "^7.0.3", - "eslint": "^8.56.0", + "eslint": "^8.57.0", "ts-node": "^10.9.2", - "typescript": "^5.3.3" + "typescript": "^5.4.2" }, "packageManager": "yarn@4.1.1" } From 6e6e84e25019e63ed424b2b8a7bc01b0e20038bf Mon Sep 17 00:00:00 2001 From: Taken Date: Thu, 21 Mar 2024 23:52:56 +0100 Subject: [PATCH 4/5] Moved to using unix format instead of dos --- .eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index fdf3994..38dc1e6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,7 +24,7 @@ module.exports = { plugins: ["@typescript-eslint"], rules: { indent: ["error", 4, { SwitchCase: 1 }], - "linebreak-style": ["error", "windows"], + "linebreak-style": ["error", "unix"], quotes: ["warn", "double"], semi: ["error", "never"], "no-unused-vars": "off", From 2cd1187e715b58469c1fcd76d66e1ebf1bb7461e Mon Sep 17 00:00:00 2001 From: Taken Date: Fri, 22 Mar 2024 20:54:51 +0100 Subject: [PATCH 5/5] Updated bot Signed-off-by: Taken --- nodemon-js.json | 1 - nodemon.json | 3 +-- src/commands/instructions.ts | 19 ++++++++++++------- src/events/server/ready/status.ts | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/nodemon-js.json b/nodemon-js.json index 6cb63a7..f6c3038 100644 --- a/nodemon-js.json +++ b/nodemon-js.json @@ -3,7 +3,6 @@ "ignore": [ ".git", "node_modules/**/node_modules", - "dist/config", "src" ], "verbose": true, diff --git a/nodemon.json b/nodemon.json index d6b0922..107265b 100644 --- a/nodemon.json +++ b/nodemon.json @@ -2,8 +2,7 @@ "restartable": "rs", "ignore": [ ".git", - "node_modules/**/node_modules", - "dist/config" + "node_modules/**/node_modules" ], "verbose": true, "env": { diff --git a/src/commands/instructions.ts b/src/commands/instructions.ts index bac0b62..a847bf9 100644 --- a/src/commands/instructions.ts +++ b/src/commands/instructions.ts @@ -1,6 +1,7 @@ import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js" import { embedColor, devMessage, instructionsgif } from "config/options" import { ICommand } from "interfaces" +import { removeIndents } from "utils/functions/funcs" export = { name: "instructions", @@ -18,12 +19,17 @@ export = { await interaction.reply({ embeds: [{ title: "Verification", - description: "1. Log onto hypixel.\n" + - "2. Right click with the head in your hotbar.\n" + - "3. Click on the social media icon.\n" + - "4. Click on the discord icon.\n" + - "5. Type your username in the chat and press enter.\n" + - "6. Run the `/verify` command in this channel.\n", + description: removeIndents(` + - Log onto hypixel. + - Right click with the head in your hotbar. + - Click on the social media icon. + - Click on the discord icon. + - Type your username in the chat and press enter. + - Run the \`/verify\` command in this channel. + `), + thumbnail: { + url: interaction.guild?.iconURL() || "" + }, color: embedColor, footer: { text: interaction.guild!.name + " | " + devMessage, @@ -31,7 +37,6 @@ export = { }, image: { url: instructionsgif, - proxy_url: instructionsgif } }] }) diff --git a/src/events/server/ready/status.ts b/src/events/server/ready/status.ts index bfb42f8..9184f2e 100644 --- a/src/events/server/ready/status.ts +++ b/src/events/server/ready/status.ts @@ -27,7 +27,7 @@ export = { setInterval(() => { const status = i++ % statuses.length user.setActivity({ name: getActivity(statuses[status].name), type: statuses[status].type }) - }, 1000 * 60 * 10) + }, 1000 * 60) user.setStatus("dnd") }