布鲁诺 普雷托
布鲁诺 普雷托
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by 布鲁诺 普雷托 on 2/3/2024 in #djs-questions
ffmpeg errors
node:events:492
throw er; // Unhandled 'error' event
^

Error: spawn ffmpeg EAGAIN
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:292:12)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -11,
code: 'EAGAIN',
syscall: 'spawn ffmpeg',
path: 'ffmpeg',
spawnargs: [
'-i',
'/home/brunommpreto/Music/CloudMusic/TBT Prod. - Gangsta Gangsta(TBT Remix).mp3',
'-analyzeduration',
'0',
'-loglevel',
'0',
'-acodec',
'libopus',
'-f',
'opus',
'-ar',
'48000',
'-ac',
'2',
'pipe:1'
]
}
node:events:492
throw er; // Unhandled 'error' event
^

Error: spawn ffmpeg EAGAIN
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:292:12)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -11,
code: 'EAGAIN',
syscall: 'spawn ffmpeg',
path: 'ffmpeg',
spawnargs: [
'-i',
'/home/brunommpreto/Music/CloudMusic/TBT Prod. - Gangsta Gangsta(TBT Remix).mp3',
'-analyzeduration',
'0',
'-loglevel',
'0',
'-acodec',
'libopus',
'-f',
'opus',
'-ar',
'48000',
'-ac',
'2',
'pipe:1'
]
}
here is my code, part of it:
try {
// Replace 'path/to/your/local/folder' with the path to your local folder containing audio files
const folderPath='/home/brunommpreto/Music/CloudMusic/';
//If theres already a queue avoid re-reading them
if (!queue.length && !running) {
// Read all files in the folder
const files=fs.readdirSync(folderPath);
let i=0;
for (const file of files) {
if (file.toLowerCase().endsWith('.mp3')) {
const filePath=path.join(folderPath, file.replace(/(['"()])/g, '\\$1'));
const resource=await createAudioResource(filePath, { inputType: StreamType.WebmOpus });
queue.push(resource);
i++;
console.log("Loaded " + i + " of " + files.length)
}
}
queue=queue.sort((a, b) => 0.5 - Math.random())
}

if (!isPlaying) {
await playNextTrack(newState);
running = true
}
} catch (error) {
console.error('Error joining voice channel:', error);
}
try {
// Replace 'path/to/your/local/folder' with the path to your local folder containing audio files
const folderPath='/home/brunommpreto/Music/CloudMusic/';
//If theres already a queue avoid re-reading them
if (!queue.length && !running) {
// Read all files in the folder
const files=fs.readdirSync(folderPath);
let i=0;
for (const file of files) {
if (file.toLowerCase().endsWith('.mp3')) {
const filePath=path.join(folderPath, file.replace(/(['"()])/g, '\\$1'));
const resource=await createAudioResource(filePath, { inputType: StreamType.WebmOpus });
queue.push(resource);
i++;
console.log("Loaded " + i + " of " + files.length)
}
}
queue=queue.sort((a, b) => 0.5 - Math.random())
}

if (!isPlaying) {
await playNextTrack(newState);
running = true
}
} catch (error) {
console.error('Error joining voice channel:', error);
}
14 replies
DIAdiscord.js - Imagine an app
Created by 布鲁诺 普雷托 on 11/18/2023 in #djs-questions
Know which device it it
Is there a way to know in which device the user is? I have a few interactions that work 100% on the computer/web, but on mobile it gets laggy, so i want to have 2 response types, desktop and mobile, so the UI is more pleasant
13 replies
DIAdiscord.js - Imagine an app
Created by 布鲁诺 普雷托 on 6/1/2023 in #djs-questions
Click Button Error
3 replies
DIAdiscord.js - Imagine an app
Created by 布鲁诺 普雷托 on 5/26/2023 in #djs-questions
Button to show modal
7 replies
DIAdiscord.js - Imagine an app
Created by 布鲁诺 普雷托 on 5/22/2023 in #djs-questions
Autocomplete 25 entries limit bypass
How can I bypass the 25 entries limit? I have an array of about 8000 entries sad
'arabacal', 'westcoast', 'SNIFES',
'jomal', '....', 'sharkmaster',
'- Just Try Me o.O', 'JORGED', 'pfialho1',
'speed7', 'Vilarelhos', 'Kroll',
'vaskinadore', 'jbaiao', 'pmrf',
'JOSE GREGORIO', 'joao rangel', 'adelinomartins',
'VelhoVelho', 'fernandes74', 'Cullen Bohannon',
'crackbreak', 'Rui Peres', 'Lucifer125',
'dragonball007', 'zepirikito', 'fabado',
'reisdavid1', 'and282', 'bcchina',
'CarryDaGuarda', 'Costini', 'Pipo Manobra',
'costa67', 'canario28', 'KART46',
'ALLGAR I', 'fafito', 'Nita23',
'bull13', 'xavs', 'Sensei16',
'Dead Pirate', 'roger chelas', 'montemurensse',
'blackkamikase', 'RodrigoBeck', 'carp6969',
'RODRYGORS', 'Jack o Estripador', 'Adesir Braun',
'hiphoptuga', 'agedeão', 'elekid',
'krilinm', 'levezinho', 'Exkimo',
'Luis Dinis', 'dias carlos', 'jaymor',
'JAguiar', 'Lhitow', 'MrErbalist',
'panicoo', 'PLDelta', 'castelo branco',
'Brother Minifix', 'odmilso', 'mjbel',
'SirGuedes', 'sonatas', 'Pintarolas100',
'dragon78', 'kinng', 'VMOM',
'Vandrakens', 'Bullet', 'carolina*',
'valente rui', 'Paulo sobral', 'FUTAIVLOG',
'esteves94', 'tiranio', 'timor',
'passarao123', 'hipol', 'marot',
'Tonho Bruto', 'Selma Nunes', 'james 007',
'saizo', 'Superb Lich', 'lotario',
'SPNA', 'claudinho marques', 'King Tour',
'saraaf', 'MasterFilipe', 'Tiagoacp',
'Aniquilador total',
... 7580 more items
]
'arabacal', 'westcoast', 'SNIFES',
'jomal', '....', 'sharkmaster',
'- Just Try Me o.O', 'JORGED', 'pfialho1',
'speed7', 'Vilarelhos', 'Kroll',
'vaskinadore', 'jbaiao', 'pmrf',
'JOSE GREGORIO', 'joao rangel', 'adelinomartins',
'VelhoVelho', 'fernandes74', 'Cullen Bohannon',
'crackbreak', 'Rui Peres', 'Lucifer125',
'dragonball007', 'zepirikito', 'fabado',
'reisdavid1', 'and282', 'bcchina',
'CarryDaGuarda', 'Costini', 'Pipo Manobra',
'costa67', 'canario28', 'KART46',
'ALLGAR I', 'fafito', 'Nita23',
'bull13', 'xavs', 'Sensei16',
'Dead Pirate', 'roger chelas', 'montemurensse',
'blackkamikase', 'RodrigoBeck', 'carp6969',
'RODRYGORS', 'Jack o Estripador', 'Adesir Braun',
'hiphoptuga', 'agedeão', 'elekid',
'krilinm', 'levezinho', 'Exkimo',
'Luis Dinis', 'dias carlos', 'jaymor',
'JAguiar', 'Lhitow', 'MrErbalist',
'panicoo', 'PLDelta', 'castelo branco',
'Brother Minifix', 'odmilso', 'mjbel',
'SirGuedes', 'sonatas', 'Pintarolas100',
'dragon78', 'kinng', 'VMOM',
'Vandrakens', 'Bullet', 'carolina*',
'valente rui', 'Paulo sobral', 'FUTAIVLOG',
'esteves94', 'tiranio', 'timor',
'passarao123', 'hipol', 'marot',
'Tonho Bruto', 'Selma Nunes', 'james 007',
'saizo', 'Superb Lich', 'lotario',
'SPNA', 'claudinho marques', 'King Tour',
'saraaf', 'MasterFilipe', 'Tiagoacp',
'Aniquilador total',
... 7580 more items
]
11 replies
DIAdiscord.js - Imagine an app
Created by 布鲁诺 普雷托 on 5/22/2023 in #djs-questions
Missing Permissions
13 replies
DIAdiscord.js - Imagine an app
Created by 布鲁诺 普雷托 on 2/1/2023 in #djs-questions
Message Commands and Actions
Hi, I've been for the past 2 hours trying to understand the commands that are prompt using < /test:0>, up till now what I understood is that </test:0> in a message will create some sort of built-in hyperlink and automatically fill the message prompt with /test. And the 0 is the command ID Similar to this there's <@USER_ID> My question is, what else can be done in the </Command:C_id> or what other cool stuff can be done using <> . I can't seem to find any documentation on this.
5 replies
DIAdiscord.js - Imagine an app
Created by 布鲁诺 普雷托 on 11/28/2022 in #djs-questions
Command Interactions Handler
So I have the folder ./commands, where I've got my commands, all is good there, however with button/menu interactions I manage them in the index.js file, I'm wondering if theres a way to handle them externaly in another file
37 replies
DIAdiscord.js - Imagine an app
Created by 布鲁诺 普雷托 on 11/21/2022 in #djs-questions
Create TextChannels
80 replies