mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(recorder-example): bump dependencies (#8123)
This commit is contained in:
@@ -14,15 +14,15 @@
|
||||
"author": "Amish Shah <contact@shah.gg>",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@discordjs/opus": "^0.5.3",
|
||||
"discord-api-types": "^0.30.0",
|
||||
"discord.js": "^13.7.0",
|
||||
"@discordjs/opus": "^0.8.0",
|
||||
"discord-api-types": "^0.33.3",
|
||||
"discord.js": "^13.8.0",
|
||||
"libsodium-wrappers": "^0.7.9",
|
||||
"node-crc": "^1.3.2",
|
||||
"prism-media": "^2.0.0-alpha.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tsconfig-paths": "^3.10.1",
|
||||
"typescript": "~4.3.5"
|
||||
"typescript": "^4.7.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
import Discord, { Events, Interaction } from 'discord.js';
|
||||
import { getVoiceConnection } from '@discordjs/voice';
|
||||
import { GatewayIntentBits } from 'discord-api-types/v9';
|
||||
import Discord, { Interaction, Constants } from 'discord.js';
|
||||
import { deploy } from './deploy';
|
||||
import { interactionHandlers } from './interactions';
|
||||
import { GatewayIntentBits } from 'discord-api-types/v9';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
|
||||
const { token } = require('../auth.json');
|
||||
const { token } = require('../auth.json') as { token: string };
|
||||
|
||||
const client = new Discord.Client({
|
||||
intents: [GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildMessages, GatewayIntentBits.Guilds],
|
||||
});
|
||||
|
||||
client.on(Events.ClientReady, () => console.log('Ready!'));
|
||||
const { Events } = Constants;
|
||||
|
||||
client.on(Events.MessageCreate, async (message) => {
|
||||
client.on(Events.CLIENT_READY, () => console.log('Ready!'));
|
||||
|
||||
client.on(Events.MESSAGE_CREATE, async (message) => {
|
||||
if (!message.guild) return;
|
||||
if (!client.application?.owner) await client.application?.fetch();
|
||||
|
||||
@@ -28,7 +30,7 @@ client.on(Events.MessageCreate, async (message) => {
|
||||
*/
|
||||
const recordable = new Set<string>();
|
||||
|
||||
client.on(Events.InteractionCreate, async (interaction: Interaction) => {
|
||||
client.on(Events.INTERACTION_CREATE, async (interaction: Interaction) => {
|
||||
if (!interaction.isCommand() || !interaction.guildId) return;
|
||||
|
||||
const handler = interactionHandlers.get(interaction.commandName);
|
||||
@@ -44,6 +46,6 @@ client.on(Events.InteractionCreate, async (interaction: Interaction) => {
|
||||
}
|
||||
});
|
||||
|
||||
client.on(Events.Error, console.warn);
|
||||
client.on(Events.ERROR, console.warn);
|
||||
|
||||
void client.login(token);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { createWriteStream } from 'node:fs';
|
||||
import { pipeline } from 'node:stream';
|
||||
import { EndBehaviorType, VoiceReceiver } from '@discordjs/voice';
|
||||
import type { User } from 'discord.js';
|
||||
import { createWriteStream } from 'node:fs';
|
||||
import prism from 'prism-media';
|
||||
import { pipeline } from 'node:stream';
|
||||
import * as prism from 'prism-media';
|
||||
|
||||
function getDisplayName(userId: string, user?: User) {
|
||||
return user ? `${user.username}_${user.discriminator}` : userId;
|
||||
@@ -12,7 +12,7 @@ export function createListeningStream(receiver: VoiceReceiver, userId: string, u
|
||||
const opusStream = receiver.subscribe(userId, {
|
||||
end: {
|
||||
behavior: EndBehaviorType.AfterSilence,
|
||||
duration: 100,
|
||||
duration: 1000,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"outDir": "dist",
|
||||
"skipLibCheck": true,
|
||||
"paths": {
|
||||
"@discordjs/voice": ["../../"],
|
||||
"libsodium-wrappers": ["./node_modules/libsodium-wrappers"]
|
||||
|
||||
Reference in New Issue
Block a user