Skip to content

Commit

Permalink
Merge pull request #1 from titsex/develop
Browse files Browse the repository at this point in the history
distube v5 support
  • Loading branch information
titsex authored Sep 14, 2024
2 parents 4c67d30 + 6c5e962 commit 42e5586
Show file tree
Hide file tree
Showing 23 changed files with 1,633 additions and 3,700 deletions.
17 changes: 0 additions & 17 deletions .eslintrc

This file was deleted.

2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

10 changes: 0 additions & 10 deletions .prettierrc

This file was deleted.

58 changes: 8 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
Custom Distube plugin for VK Music support.

# Feature
| type | example link | ☑️ |
|--------------|-------------------------------------------------|----|
| playlist | https://vk.com/music/playlist/-192000782_406 ||
| album | https://vk.com/music/album/-2000892528_18892528 ||
| artist | https://vk.com/artist/nepridymal_mty0oty4odm2mw ||
| audio | https://vk.com/audio-2001624323_122624323 ||
| user audios | https://vk.com/titsex ||
| group audios | https://vk.com/ne_pridymal_group ||
| type | example link | ☑️ |
|----------|-------------------------------------------------|----|
| playlist | https://vk.com/music/playlist/-192000782_406 ||
| album | https://vk.com/music/album/-2000892528_18892528 ||
| artist | https://vk.com/artist/nepridymal_mty0oty4odm2mw ||
| audio | https://vk.com/audio-2001624323_122624323 ||
| group | https://vk.com/titsex ||
| user | https://vk.com/ne_pridymal_group ||

# Installation
```
Expand Down Expand Up @@ -52,48 +52,6 @@ const distube = new DisTube(client, {
client.login('bot token')
```

# Example of plugin error handling
```ts
import { VK_PLUGIN_ERROR_CODE, VKMusicPluginErrors } from 'distube-vk-music-plugin'
import { DisTubeError } from 'distube'

client.on('error', (error) => {
if (error instanceof DisTubeError) {
if (error.errorCode === VK_PLUGIN_ERROR_CODE) {
switch (error.message as VKMusicPluginErrors) {
case VKMusicPluginErrors.PLAYLIST_NOT_FOUND:
// code here...
break
case VKMusicPluginErrors.PLAYLIST_SONGS_NOT_FOUND:
// code here...
break
case VKMusicPluginErrors.ARTIST_NOT_FOUND:
// code here...
break
case VKMusicPluginErrors.ARTIST_SONGS_NOT_FOUND:
// code here...
break
case VKMusicPluginErrors.AUDIO_NOT_FOUND:
// code here...
break
case VKMusicPluginErrors.USER_OR_GROUP_NOT_FOUND:
// code here...
break
case VKMusicPluginErrors.URL_NOT_SUPPORT:
// code here...
break
case VKMusicPluginErrors.ACCESS_DENIED:
// code here...
break
default:
// Unexpected errors, create an issue here: https://github.com/titsex/distube-vk-music-plugin/issues
break
}
}
}
})
```

# Documentation
### VKMusicPlugin[VKMusicPluginOptions]
* ```token``` is required, to get it, follow the [link](https://oauth.vk.com/authorize?client_id=2685278&scope=65536&response_type=token&revoke=1), click "allow" and copy everything between access_token= and &expires_in
33 changes: 33 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": false
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noNonNullAssertion": "off"
},
"suspicious": {
"noConfusingVoidType": "off"
},
"complexity": {
"noStaticOnlyClass": "off"
}
}
},
"javascript": {
"formatter": {
"semicolons": "asNeeded",
"quoteStyle": "single",
"indentWidth": 4,
"trailingCommas": "es5",
"bracketSpacing": true,
"quoteProperties": "asNeeded",
"lineEnding": "crlf",
"lineWidth": 100
}
}
}
89 changes: 37 additions & 52 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,39 @@
{
"name": "distube-vk-music-plugin",
"description": "A DisTube custom plugin for supporting VK Music.",
"author": "titsex",
"version": "1.3.4",
"main": "./dist/plugin.js",
"types": "./dist/plugin.d.ts",
"exports": "./dist/plugin.js",
"directories": {
"lib": "src"
},
"files": [
"dist"
],
"scripts": {
"build": "tsup",
"build:check": "tsc"
},
"repository": {
"type": "git",
"url": "git+https://github.com/titsex/distube-vk-music-plugin.git"
},
"keywords": [
"distube",
"plugin",
"vk",
"music",
"vkmusic",
"discord"
],
"bugs": {
"url": "https://github.com/titsex/distube-vk-music-plugin/issues"
},
"homepage": "https://github.com/titsex/distube-vk-music-plugin#readme",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"dotenv": "^16.3.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.1",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
},
"dependencies": {
"axios": "^1.6.5"
},
"peerDependencies": {
"discord.js": "14",
"distube": "^3.3.1||4"
}
"name": "distube-vk-music-plugin",
"description": "A DisTube custom plugin for supporting VK Music.",
"author": "titsex",
"version": "2.0.0",
"main": "./dist/plugin.js",
"types": "./dist/plugin.d.ts",
"exports": "./dist/plugin.js",
"directories": {
"lib": "src"
},
"files": ["dist"],
"scripts": {
"format": "biome format ./src",
"lint": "biome lint ./src",
"build": "tsc && tsup"
},
"repository": {
"type": "git",
"url": "git+https://github.com/titsex/distube-vk-music-plugin.git"
},
"keywords": ["distube", "plugin", "vk", "music", "vkmusic", "discord"],
"bugs": {
"url": "https://github.com/titsex/distube-vk-music-plugin/issues"
},
"homepage": "https://github.com/titsex/distube-vk-music-plugin#readme",
"devDependencies": {
"@biomejs/biome": "^1.9.0",
"discord.js": "^14.16.2",
"tsup": "^8.2.4",
"typescript": "^5.6.2"
},
"dependencies": {
"vk-music-api-wrapper": "^1.0.5"
},
"peerDependencies": {
"distube": "5"
}
}
Loading

0 comments on commit 42e5586

Please sign in to comment.