Spidey 🕸
Spidey 🕸
DIAdiscord.js - Imagine an app
Created by Spidey 🕸 on 5/15/2025 in #djs-voice
Voice connection stop after short time
I have read that top same issue there u was talking about version of discordjs/voice but my npm version is latest and I have cross checked now why this happened with me?
16 replies
DIAdiscord.js - Imagine an app
Created by Spidey 🕸 on 3/17/2023 in #djs-voice
help on finish
is here any event when player finish?? i want to stop player after of finish
7 replies
DIAdiscord.js - Imagine an app
Created by Spidey 🕸 on 3/17/2023 in #djs-voice
music play but doesn't sound
js
const { ActionRowBuilder, ButtonBuilder, ButtonStyle, Events, Client, GatewayIntentBits, Partials, Collection, ActivityType, SelectMenuBuilder } = require("discord.js");


const { createReadStream } = require('node:fs');
const { join } = require('node:path');
const { AudioPlayerStatus, StreamType, createAudioResource, createAudioPlayer } = require('@discordjs/voice');

const { joinVoiceChannel, getVoiceConnection } = require('@discordjs/voice');


const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessages,
],
partials: [
Partials.Channel,
Partials.Message,
Partials.User,
Partials.GuildMember,
],
});

// list of sounds to play
//use always "./files" like this
const sounds = [
'./audio1.mp3',
'./audio2.mp3',
'./audio3.mp3'
];

client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
console.log(client.channels);
});


client.on('messageCreate', async message => {
if (message.content === '!play') {
// check if bot is in a voice channel
const channel = client.channels.cache.find(c => c.name === "ポvcポ");



const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
selfDeaf: false,
selfMute: false // this may also
});

const player = createAudioPlayer();

// pick a random sound to play
const sound = sounds[Math.floor(Math.random() * sounds.length)];



// Thanks
js
const { ActionRowBuilder, ButtonBuilder, ButtonStyle, Events, Client, GatewayIntentBits, Partials, Collection, ActivityType, SelectMenuBuilder } = require("discord.js");


const { createReadStream } = require('node:fs');
const { join } = require('node:path');
const { AudioPlayerStatus, StreamType, createAudioResource, createAudioPlayer } = require('@discordjs/voice');

const { joinVoiceChannel, getVoiceConnection } = require('@discordjs/voice');


const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessages,
],
partials: [
Partials.Channel,
Partials.Message,
Partials.User,
Partials.GuildMember,
],
});

// list of sounds to play
//use always "./files" like this
const sounds = [
'./audio1.mp3',
'./audio2.mp3',
'./audio3.mp3'
];

client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
console.log(client.channels);
});


client.on('messageCreate', async message => {
if (message.content === '!play') {
// check if bot is in a voice channel
const channel = client.channels.cache.find(c => c.name === "ポvcポ");



const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
selfDeaf: false,
selfMute: false // this may also
});

const player = createAudioPlayer();

// pick a random sound to play
const sound = sounds[Math.floor(Math.random() * sounds.length)];



// Thanks
10 replies