! はげたこ
! はげたこ
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
ok
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
{
"name": "Discord-js-v14-template-for-glitch",
"version": "14",
"description": "It is template of Discord.js v14.",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"discord.js": "^14.13.0",
"canvacord": "^5.4.10",
"canvas": "^2.11.2",
"fs": "^0.0.2",
"discord-welcome-card": "^4.9.3",
"@discordjs/voice": "^0.17.0",
"libsodium-wrappers": "^0.7.13",
"ffmpeg": "^0.0.4"
},
"engines": {
"node": "16.x"
},
"repository": {
"url": "https://glitch.com/edit/#!/discord-js-v14-template-glitch"
},
"license": "MIT",
"keywords": [
"node",
"glitch",
"template"
]
}
{
"name": "Discord-js-v14-template-for-glitch",
"version": "14",
"description": "It is template of Discord.js v14.",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"discord.js": "^14.13.0",
"canvacord": "^5.4.10",
"canvas": "^2.11.2",
"fs": "^0.0.2",
"discord-welcome-card": "^4.9.3",
"@discordjs/voice": "^0.17.0",
"libsodium-wrappers": "^0.7.13",
"ffmpeg": "^0.0.4"
},
"engines": {
"node": "16.x"
},
"repository": {
"url": "https://glitch.com/edit/#!/discord-js-v14-template-glitch"
},
"license": "MIT",
"keywords": [
"node",
"glitch",
"template"
]
}
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
😢
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
thank you for your reply It doesn't play even if I change the code as below
client.once('ready', async () => {
console.log('Ready!');
const guild = await client.guilds.fetch('1236559277670531142');
const channel = client.channels.cache.get('1236989524903723028');
const connection = joinVoiceChannel({
channelId: '1236989524903723028',
guildId: '1236559277670531142',
adapterCreator: channel.guild.voiceAdapterCreator
});
connection.subscribe(player);
});

player.on(AudioPlayerStatus.Idle, () => {
console.log('Idle state detected. Playing audio...');
const loopUrl = 'https://cdn.glitch.global/c2c4a2c3-b622-45de-81be-91a67ca39b93/Chill-beats-lofi-hiphop-mix-__-study_chill_stay-home-playlist%E3%80%90night-lullaby% E3%80%91.ogg';
const resource = createAudioResource(loopUrl);
player.play(resource);
});
client.once('ready', async () => {
console.log('Ready!');
const guild = await client.guilds.fetch('1236559277670531142');
const channel = client.channels.cache.get('1236989524903723028');
const connection = joinVoiceChannel({
channelId: '1236989524903723028',
guildId: '1236559277670531142',
adapterCreator: channel.guild.voiceAdapterCreator
});
connection.subscribe(player);
});

player.on(AudioPlayerStatus.Idle, () => {
console.log('Idle state detected. Playing audio...');
const loopUrl = 'https://cdn.glitch.global/c2c4a2c3-b622-45de-81be-91a67ca39b93/Chill-beats-lofi-hiphop-mix-__-study_chill_stay-home-playlist%E3%80%90night-lullaby% E3%80%91.ogg';
const resource = createAudioResource(loopUrl);
player.play(resource);
});
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
console.log('Idle state detected. Playing audio...'); will not be displayed forever
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
😢
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
I changed the code like this, but it still doesn't play;
const player = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
});

client.once('ready', async () => {
console.log('Ready!');
const guildId = '1236559277670531142';
const channelId = '1236989524903723028';
const loopUrl = 'https://cdn.glitch.global/c2c4a2c3-b622-45de-81be-91a67ca39b93/Chill-beats-lofi-hiphop-mix-__-study_chill_stay-home-playlist%E3%80%90night-lullaby% E3%80%91.ogg?v=1715028861751';
const guild = await client.guilds.fetch('1236559277670531142');
const connection = joinVoiceChannel({
adapterCreator: guild.voiceAdapterCreator,
});

connection.subscribe(player);
});

player.on(AudioPlayerStatus.Idle, () => {
console.log('Idle state detected. Playing audio...');
const loopUrl = 'https://cdn.glitch.global/c2c4a2c3-b622-45de-81be-91a67ca39b93/Chill-beats-lofi-hiphop-mix-__-study_chill_stay-home-playlist%E3%80%90night-lullaby% E3%80%91.ogg?v=1715028861751';
const resource = createAudioResource(loopUrl);
player.play(resource);
});
const player = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
});

client.once('ready', async () => {
console.log('Ready!');
const guildId = '1236559277670531142';
const channelId = '1236989524903723028';
const loopUrl = 'https://cdn.glitch.global/c2c4a2c3-b622-45de-81be-91a67ca39b93/Chill-beats-lofi-hiphop-mix-__-study_chill_stay-home-playlist%E3%80%90night-lullaby% E3%80%91.ogg?v=1715028861751';
const guild = await client.guilds.fetch('1236559277670531142');
const connection = joinVoiceChannel({
adapterCreator: guild.voiceAdapterCreator,
});

connection.subscribe(player);
});

player.on(AudioPlayerStatus.Idle, () => {
console.log('Idle state detected. Playing audio...');
const loopUrl = 'https://cdn.glitch.global/c2c4a2c3-b622-45de-81be-91a67ca39b93/Chill-beats-lofi-hiphop-mix-__-study_chill_stay-home-playlist%E3%80%90night-lullaby% E3%80%91.ogg?v=1715028861751';
const resource = createAudioResource(loopUrl);
player.play(resource);
});
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
I will check it. thank you.
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
Would you like to know more?
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
👍
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
got it. thank you.
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
For some reason the sound isn't playing
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
I checked the console.log for state changes
State changed from signaling to connecting
State changed from connecting to connecting
State changed from connecting to connecting
State changed from connecting to connecting
State changed from connecting to ready
State changed from signaling to connecting
State changed from connecting to connecting
State changed from connecting to connecting
State changed from connecting to connecting
State changed from connecting to ready
28 replies
DIAdiscord.js - Imagine an app
Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
const { AttachmentBuilder , ChannelType , Client, GatewayIntentBits, EmbedBuilder, Partials, ActivityType, ChannelSelectMenuBuilder, ActionRowBuilder, WebhookClient, PermissionsBitField, Permission } = require("discord.js");
const {StreamType, createAudioPlayer, createAudioResource, joinVoiceChannel, getVoiceConnection } = require('@discordjs/voice');


const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildIntegrations, GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.DirectMessages, GatewayIntentBits.DirectMessageReactions, GatewayIntentBits.MessageContent],
partials: [Partials.User, Partials.Channel, Partials.GuildMember, Partials.Message, Partials.Reaction]
});
const { AttachmentBuilder , ChannelType , Client, GatewayIntentBits, EmbedBuilder, Partials, ActivityType, ChannelSelectMenuBuilder, ActionRowBuilder, WebhookClient, PermissionsBitField, Permission } = require("discord.js");
const {StreamType, createAudioPlayer, createAudioResource, joinVoiceChannel, getVoiceConnection } = require('@discordjs/voice');


const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildIntegrations, GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.DirectMessages, GatewayIntentBits.DirectMessageReactions, GatewayIntentBits.MessageContent],
partials: [Partials.User, Partials.Channel, Partials.GuildMember, Partials.Message, Partials.Reaction]
});
28 replies