Skip to content

Commit

Permalink
feat: update sern and distube, move from genius to lrclib
Browse files Browse the repository at this point in the history
  • Loading branch information
SrIzan10 committed Aug 5, 2024
1 parent a26200a commit d6c530c
Show file tree
Hide file tree
Showing 28 changed files with 759 additions and 820 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/node_modules
.env
/dist
lavalink/
lavalink/
.sern/ambient.d.ts
208 changes: 208 additions & 0 deletions .sern/command-data-remote.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
{
"global": [
{
"id": "1270071328065454223",
"application_id": "842030808114266193",
"version": "1270071614733549591",
"default_member_permissions": null,
"type": 1,
"name": "volume",
"name_localizations": null,
"description": "Set the volume of the queue",
"description_localizations": null,
"dm_permission": true,
"contexts": null,
"integration_types": [
0
],
"options": [
{
"type": 10,
"name": "volume",
"name_localizations": null,
"description": "Set the volume",
"description_localizations": null,
"required": true,
"min_value": 0,
"max_value": 100
}
],
"nsfw": false
},
{
"id": "1270071614733549590",
"application_id": "842030808114266193",
"version": "1270071614733549592",
"default_member_permissions": null,
"type": 1,
"name": "todo_queue",
"name_localizations": null,
"description": "See the current queue",
"description_localizations": null,
"dm_permission": true,
"contexts": null,
"integration_types": [
0
],
"nsfw": false
},
{
"id": "1270071328065454224",
"application_id": "842030808114266193",
"version": "1270071614733549593",
"default_member_permissions": null,
"type": 1,
"name": "stop",
"name_localizations": null,
"description": "Stop the song",
"description_localizations": null,
"dm_permission": true,
"contexts": null,
"integration_types": [
0
],
"nsfw": false
},
{
"id": "1270071328065454225",
"application_id": "842030808114266193",
"version": "1270071614733549594",
"default_member_permissions": null,
"type": 1,
"name": "skip",
"name_localizations": null,
"description": "Skip the song",
"description_localizations": null,
"dm_permission": true,
"contexts": null,
"integration_types": [
0
],
"nsfw": false
},
{
"id": "1270071328577425438",
"application_id": "842030808114266193",
"version": "1270071614733549595",
"default_member_permissions": null,
"type": 1,
"name": "shuffle",
"name_localizations": null,
"description": "Shuffle the queue",
"description_localizations": null,
"dm_permission": true,
"contexts": null,
"integration_types": [
0
],
"nsfw": false
},
{
"id": "1270071328577425439",
"application_id": "842030808114266193",
"version": "1270071614733549596",
"default_member_permissions": null,
"type": 1,
"name": "resume",
"name_localizations": null,
"description": "Resume the song",
"description_localizations": null,
"dm_permission": true,
"contexts": null,
"integration_types": [
0
],
"nsfw": false
},
{
"id": "1270071328577425440",
"application_id": "842030808114266193",
"version": "1270071614733549597",
"default_member_permissions": null,
"type": 1,
"name": "play",
"name_localizations": null,
"description": "Play some music",
"description_localizations": null,
"dm_permission": true,
"contexts": null,
"integration_types": [
0
],
"options": [
{
"type": 3,
"name": "name",
"name_localizations": null,
"description": "The name of the song or URL",
"description_localizations": null,
"required": true
}
],
"nsfw": false
},
{
"id": "1270071328577425441",
"application_id": "842030808114266193",
"version": "1270071614733549598",
"default_member_permissions": null,
"type": 1,
"name": "pause",
"name_localizations": null,
"description": "Pause the song",
"description_localizations": null,
"dm_permission": true,
"contexts": null,
"integration_types": [
0
],
"nsfw": false
},
{
"id": "1270071328577425442",
"application_id": "842030808114266193",
"version": "1270071615073419358",
"default_member_permissions": null,
"type": 1,
"name": "lyrics",
"name_localizations": null,
"description": "See the lyrics",
"description_localizations": null,
"dm_permission": true,
"contexts": null,
"integration_types": [
0
],
"nsfw": false
},
{
"id": "1270071328577425443",
"application_id": "842030808114266193",
"version": "1270071615073419359",
"default_member_permissions": null,
"type": 1,
"name": "loop",
"name_localizations": null,
"description": "Loop the song or queue",
"description_localizations": null,
"dm_permission": true,
"contexts": null,
"integration_types": [
0
],
"options": [
{
"type": 10,
"name": "type",
"name_localizations": null,
"description": "0 for disable, 1 for song, 2 for queue",
"description_localizations": null,
"required": true,
"min_value": 0,
"max_value": 2
}
],
"nsfw": false
}
]
}
17 changes: 17 additions & 0 deletions .sern/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "esnext",
"moduleResolution": "node16",
"strict": true,
"skipLibCheck": true,
"target": "esnext",
"rootDirs": [
"./generated",
"../src"
]
},
"include": [
"./ambient.d.ts",
"../src"
]
}
21 changes: 0 additions & 21 deletions commands/music/todo_queue.ts

This file was deleted.

31 changes: 17 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "bask",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "tsc --watch",
"dev": "tsc-watch --onSuccess \"node dist/index.js\"",
"dev": "sern build && node .",
"build": "tsc"
},
"type": "module",
Expand All @@ -20,27 +20,30 @@
"url": "https://github.com/baskbotml/bask/issues"
},
"dependencies": {
"@discordjs/opus": "^0.9.0",
"@discordjs/voice": "^0.15.0",
"@distube/soundcloud": "^1.3.5",
"@distube/spotify": "^1.4.2",
"@distube/yt-dlp": "^1.1.3",
"@distube/ytdl-core": "^4.11.17",
"@sern/handler": "^2.6.1",
"@distube/soundcloud": "^2.0.3",
"@distube/spotify": "^2.0.2",
"@distube/youtube": "^1.0.4",
"@distube/yt-dlp": "^2.0.1",
"@distube/ytdl-core": "^4.14.2",
"@sern/handler": "^4.0.1",
"@sern/publisher": "^1.1.2",
"axios": "^1.1.3",
"discord.js": "^14.8.0",
"distube": "^4.0.4",
"discord.js": "^14.15.3",
"distube": "^5.0.2",
"dotenv": "^16.0.3",
"genius-lyrics": "^4.4.0",
"libsodium-wrappers": "^0.7.10",
"mongoose": "^6.7.0"
"mongoose": "^6.7.0",
"opusscript": "^0.1.1"
},
"devDependencies": {
"@types/express": "^4.17.14",
"@types/node": "^17.0.25",
"nodemon": "^2.0.20",
"tsc-watch": "^6.2.0",
"tsup": "^7.2.0",
"typescript": "^4.6.3"
"typescript": "^5.5.4"
},
"homepage": "https://github.com/baskbotml/bask#readme"
"homepage": "https://github.com/baskbotml/bask#readme",
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
2 changes: 1 addition & 1 deletion sern.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"language": "typescript",
"paths": {
"base": ".",
"base": "src",
"commands": "commands"
}
}
2 changes: 1 addition & 1 deletion commands/misc/eval.ts → src/commands/misc/eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default commandModule({
execute: async (ctx, args) => {
if (ctx.user.id !== '703974042700611634') return

let code: string[] | string = args[1];
let code: string[] | string = ctx.options;
code = code.join(" ") as string;
if (code.includes("await")) {
const ar = code.split(";");
Expand Down
13 changes: 6 additions & 7 deletions commands/music/loop.ts → src/commands/music/loop.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { commandModule, CommandType } from '@sern/handler';
import { ApplicationCommandOptionType } from 'discord.js';
import { distube } from '../../index.js';
import { publish } from '../../plugins/publish.js';

export default commandModule({
type: CommandType.Slash,
plugins: [publish()],
plugins: [],
description: 'Loop the song or queue',
options: [
{
Expand All @@ -18,11 +16,12 @@ export default commandModule({
},
],
//alias : [],
execute: async (ctx) => {
execute: async (ctx, args) => {
if (ctx.guild!.members.me?.voice.channelId) {
const queue = distube.getQueue(ctx.guild!);
queue?.setRepeatMode(ctx.interaction.options.getNumber('type') as number);
switch (ctx.interaction.options.getNumber('type') as number) {
const queue = args.deps.distube.getQueue(ctx.guild!);
const type = ctx.options.getNumber('type', true)
queue?.setRepeatMode(type);
switch (type) {
case 0:
await ctx.reply({
content: 'Looping has been disabled.',
Expand Down
Loading

0 comments on commit d6c530c

Please sign in to comment.