Skip to content

Commit aaa2bde

Browse files
committed
chore: release 7.2.0
1 parent 288a624 commit aaa2bde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2719
-724
lines changed

apps/music-bot/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DISCORD_TOKEN=xxx-xxx-xxx

apps/music-bot/.gitignore

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,37 @@
1-
.commandkit/
2-
dist/
3-
.streams/*
4-
!.streams/.gitkeep
1+
# dependencies
2+
node_modules
3+
4+
# build output
5+
build
6+
out
7+
dist
8+
9+
# commandkit
10+
.commandkit
11+
dist
12+
compiled-commandkit.config.mjs
13+
14+
# env
15+
**/*.env*
16+
!**/*.env.example*
17+
18+
# logging
19+
logs
20+
*.log
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
lerna-debug.log*
25+
.pnpm-debug.log*
26+
27+
# yarn v2+
28+
.yarn/cache
29+
.yarn/unplugged
30+
.yarn/build-state.yml
31+
.yarn/install-state.gz
32+
.pnp.*
33+
34+
# other
35+
**/*.DS_Store
36+
.temp-example
37+
*.pcm

apps/music-bot/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Welcome to CommandKit + TypeScript
2+
3+
> This project was generated by [create-commandkit](https://npmjs.com/package/create-commandkit).
4+
5+
Thanks for choosing CommandKit to build your Discord bot!
6+
7+
## To run this project
8+
9+
```
10+
npx commandkit dev
11+
```
12+
13+
## Useful links
14+
15+
- [Documentation](https://commandkit.dev)
16+
- [Discord](https://commandkit.dev/discord)

apps/music-bot/commandkit-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference path="node_modules/commandkit-types/index.d.ts" />

apps/music-bot/commandkit.config.mjs

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { defineConfig } from 'commandkit/config';
2+
3+
export default defineConfig({});

apps/music-bot/package.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"name": "music-bot",
3-
"version": "1.0.0",
4-
"description": "Test music bot",
3+
"description": "Discord Player test bot",
4+
"version": "0.1.0",
55
"type": "module",
6+
"private": true,
7+
"main": "dist/index.js",
68
"scripts": {
9+
"dev": "bunx cross-env NODE_OPTIONS=\"--trace-warnings\" commandkit dev",
710
"build": "commandkit build",
8-
"dev": "commandkit dev",
911
"start": "commandkit start"
1012
},
1113
"repository": {
@@ -18,10 +20,15 @@
1820
"url": "https://github.com/Androz2091/discord-player/issues"
1921
},
2022
"homepage": "https://github.com/Androz2091/discord-player#readme",
23+
"devDependencies": {
24+
"@snazzah/davey": "^0.1.9",
25+
"@types/node": "^25.3.3",
26+
"typescript": "^5.7.2"
27+
},
2128
"dependencies": {
2229
"@discord-player/extractor": "workspace:^",
23-
"commandkit": "^0.1.10",
30+
"commandkit": "^1.2.0-rc.15",
2431
"discord-player": "workspace:^",
25-
"discord.js": "^14.17.3"
32+
"discord.js": "^14.25.1"
2633
}
2734
}
Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
/* eslint-disable */
1+
import { Logger } from 'commandkit';
22
import { Player, StreamType } from 'discord-player';
33
import { Client, IntentsBitField } from 'discord.js';
4-
import { CommandKit } from 'commandkit';
54
import { createWriteStream } from 'node:fs';
6-
import { join } from 'node:path';
75

86
const client = new Client({
9-
// prettier-ignore
107
intents: [
11-
IntentsBitField.Flags.Guilds,
12-
IntentsBitField.Flags.GuildVoiceStates,
13-
IntentsBitField.Flags.GuildMembers,
14-
IntentsBitField.Flags.GuildMessages,
15-
IntentsBitField.Flags.MessageContent
16-
],
8+
IntentsBitField.Flags.Guilds,
9+
IntentsBitField.Flags.GuildVoiceStates,
10+
IntentsBitField.Flags.GuildMembers,
11+
IntentsBitField.Flags.GuildMessages,
12+
IntentsBitField.Flags.MessageContent,
13+
],
1714
});
1815

1916
const player = Player.create(client);
2017

21-
player.on('error', console.error);
22-
player.events.on('error', (_, e) => console.error(e));
23-
player.events.on('playerError', (_, e) => console.error(e));
18+
player.on('error', Logger.error);
19+
player.events.on('error', (_, e) => Logger.error(e));
20+
player.events.on('playerError', (_, e) => Logger.error(e));
2421
player.events.on('playerStart', (queue, track) => {
2522
queue.metadata.channel.send(`Started playing ${track.title}`);
2623
});
2724
player.events.on('playerFinish', (queue, track) => {
2825
queue.metadata.channel.send(`Finished playing ${track.title}`);
2926
});
3027
player.events.on('playerSeek', (queue, time) => {
31-
console.log(`Seeked ${queue.currentTrack} to ${time}ms`);
28+
Logger.log(`Seeked ${queue.currentTrack} to ${time}ms`);
29+
});
30+
player.events.on('debug', (queue, message) => {
31+
Logger.debug(message);
3232
});
3333

3434
const interceptor = player.createStreamInterceptor({
@@ -49,12 +49,4 @@ interceptor.onStream((queue, track, format, stream) => {
4949
);
5050
});
5151

52-
new CommandKit({
53-
client,
54-
bulkRegister: true,
55-
skipBuiltInValidations: true,
56-
eventsPath: join(import.meta.dirname, 'events'),
57-
commandsPath: join(import.meta.dirname, 'commands'),
58-
});
59-
60-
await client.login();
52+
export default client;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ChatInputCommand } from 'commandkit';
2+
3+
export const command = {
4+
name: 'ping',
5+
description: 'Ping pong!',
6+
};
7+
8+
export const chatInput: ChatInputCommand = async ({ interaction }) => {
9+
await interaction.reply('Pong!');
10+
};

apps/music-bot/src/commands/music/bassboost.ts renamed to apps/music-bot/src/app/commands/(music)/bassboost.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { SlashCommandProps } from 'commandkit';
1+
import { ChatInputCommand } from 'commandkit';
22
import { useQueue } from 'discord-player';
33
import { SlashCommandBuilder } from 'discord.js';
44

5-
export const data = new SlashCommandBuilder()
5+
export const command = new SlashCommandBuilder()
66
.setName('bassboost')
77
.setDescription('Toggle bassboost filter')
88
.addBooleanOption((option) =>
@@ -12,7 +12,7 @@ export const data = new SlashCommandBuilder()
1212
.setRequired(true),
1313
);
1414

15-
export async function run({ interaction }: SlashCommandProps) {
15+
export const chatInput: ChatInputCommand = async ({ interaction }) => {
1616
if (!interaction.inCachedGuild()) return;
1717

1818
const queue = useQueue(interaction.guildId);
@@ -48,4 +48,4 @@ export async function run({ interaction }: SlashCommandProps) {
4848
await interaction.editReply(
4949
`Bassboost is now ${on ? 'enabled' : 'disabled'}`,
5050
);
51-
}
51+
};

0 commit comments

Comments
 (0)