Skip to content

Commit

Permalink
feat(music-module): 1.1 and fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Sep 23, 2023
1 parent f9c024a commit 3994694
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 116 deletions.
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@vue/eslint-config-typescript": "12.0.0",
"@vue/tsconfig": "0.4.0",
"autoprefixer": "10.4.16",
"eslint": "8.49.0",
"eslint": "8.50.0",
"eslint-plugin-vue": "9.17.0",
"postcss": "8.4.30",
"tailwindcss": "3.3.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@trivago/prettier-plugin-sort-imports": "4.2.0",
"@typescript-eslint/eslint-plugin": "6.7.2",
"@typescript-eslint/parser": "6.7.2",
"eslint": "8.49.0",
"eslint": "8.50.0",
"prettier": "3.0.3",
"typescript": "5.2.2"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@types/node": "18.17.18",
"@typescript-eslint/eslint-plugin": "6.7.2",
"@typescript-eslint/parser": "6.7.2",
"eslint": "8.49.0",
"eslint": "8.50.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-prettier": "5.0.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/music-module/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ See also: [GitHub Releases](https://github.com/Leomotors/cocoa-discord/releases)
- Not all change will be noted, see commits for _full_ changelog
- Some pre-release or beta build may not appear here

## [1.1.0] - 2023-09-23

- fix: undefined text in embed
- feat(cognitive): increase content length limit to 200

## [1.0.0] - 2023-09-22

- chore: bump deps
Expand Down
4 changes: 1 addition & 3 deletions packages/music-module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,4 @@ _Note: Picture from previous release, lazy to update_

- This module has its cog named "Music", be sure to not creating a duplicate name

- Despite cocoa-discord supports CommonJS, this module does not

- This module is still in beta, not implemented features includes but not limited to: Working in edge cases for example, user invoke command without being in voice channel
- Some edge cases like user invoke command without being in voice channel might not be handled yet
4 changes: 2 additions & 2 deletions packages/music-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cocoa-discord/music-module",
"version": "1.0.0",
"version": "1.1.0",
"description": "discord.js music bot that can be run standalone or as a module for other bots",
"main": "dist/index.js",
"typings": "./dist/index.d.ts",
Expand Down Expand Up @@ -31,7 +31,7 @@
"@typescript-eslint/eslint-plugin": "6.7.2",
"@typescript-eslint/parser": "6.7.2",
"dotenv": "16.3.1",
"eslint": "8.49.0",
"eslint": "8.50.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-prettier": "5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/music-module/src/adapters/cognitive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export class CognitiveAdapter implements Playable {
.addFields({
name: "Content",
value:
this.content.length > 50
? this.content.slice(0, 50) + "..."
this.content.length > 200
? this.content.slice(0, 200) + "..."
: this.content,
});

Expand Down
4 changes: 3 additions & 1 deletion packages/music-module/src/adapters/youtube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export class YoutubeAdapter implements Playable {
.use(ctx)
.setTitle(title)
.setDescription(
`[${this.video.title}](${this.video.url})\n${extraDescription}`.trim(),
`[${this.video.title}](${this.video.url})\n${
extraDescription ?? ""
}`.trim(),
)
.setThumbnail(pickLast(this.video.thumbnails)?.url ?? "")
.addInlineFields(
Expand Down
1 change: 1 addition & 0 deletions packages/music-module/src/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export async function patchPlayDl() {

if (content.includes("markersMap?.find")) {
console.warn("WARNING: play-dl is already patched");
return;
}

const afterContent = content.replace("markersMap.find", "markersMap?.find");
Expand Down
Loading

0 comments on commit 3994694

Please sign in to comment.