Aviv
Aviv
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
hey, i couldn't find any reliable form of making the client listen to vocal input when its connected. can i have some guidance about it?
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/16/2023 in #djs-voice
im getting the classic AudioPlayerError: aborted.
Error:
AudioPlayerError: aborted
at connResetException (node:internal/errors:691:14)
at TLSSocket.socketCloseListener (node:_http_client:402:19)
at TLSSocket.emit (node:events:538:35)
at node:net:687:12
at TCP.done (node:_tls_wrap:580:7) {
resource: AudioResource {
playStream: OggDemuxer {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
_remainder: null,
_head: null,
_bitstream: null,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: [Function: bound onwrite]
},
edges: [ [Object], [Object] ],
metadata: null,
volume: undefined,
encoder: undefined,
audioPlayer: AudioPlayer {
_events: [Object: null prototype],
_eventsCount: 1,
_maxListeners: undefined,
_state: [Object],
subscribers: [Array],
behaviors: [Object],
debug: [Function (anonymous)],
[Symbol(kCapture)]: false
},
playbackDuration: 15720,
started: true,
silencePaddingFrames: 5,
silenceRemaining: -1
}
}
AudioPlayerError: aborted
at connResetException (node:internal/errors:691:14)
at TLSSocket.socketCloseListener (node:_http_client:402:19)
at TLSSocket.emit (node:events:538:35)
at node:net:687:12
at TCP.done (node:_tls_wrap:580:7) {
resource: AudioResource {
playStream: OggDemuxer {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
_remainder: null,
_head: null,
_bitstream: null,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: [Function: bound onwrite]
},
edges: [ [Object], [Object] ],
metadata: null,
volume: undefined,
encoder: undefined,
audioPlayer: AudioPlayer {
_events: [Object: null prototype],
_eventsCount: 1,
_maxListeners: undefined,
_state: [Object],
subscribers: [Array],
behaviors: [Object],
debug: [Function (anonymous)],
[Symbol(kCapture)]: false
},
playbackDuration: 15720,
started: true,
silencePaddingFrames: 5,
silenceRemaining: -1
}
}
the code is just creating a resource out of stream from ytdl and player playing that resource.
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/15/2023 in #djs-voice
Weirdest bug i've encountered, probably need a discordjs/voice contributor help here.
Hello, i made a discord player for playing music and tts messages. the youtube way: get stream from ytdl with filter audioonly, and inserting to queue the AudioResource using createAudioResource(stream). then to play (in short) i basically do connection.connect(player), and player.play(resource). the tts way: im generating a tts mp3 file by query using google tts api, im getting the url from the api and then i fetch it using axios.get and requesting it to be responseType: 'stream'. then i define a write stream assigning my audio file path, using pipeline to insert my data into the path and creating a mp3 file. then i make an AudioResource of it using createAudioResource('-audiofilepath-') and pushing it into queue. then its the same play function as the music one only its targeting the tts queue (which works fine). my problem is for some reason when i run a music command and (after a while after its back to idle) a tts command the player just buffers it for an infinite amount of time while i can play the other way around and use tts and then music without a problem. i can also play music and then music as well with no problem. only when its tts and after it music (after idle) it just buffers endlessly. any help would do, open to ideas and would really love if we could go over this on voice chat as we could run through it. thanks in advance!
5 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/12/2023 in #djs-voice
Destroy player when session is finished.
Hello, i wanted to know if there's a way for the player to stop playing completely once i've finished with my session manually (like removing the bot from the conversation). i cleared the queue and added player.stop() alongside with prehamptive connection.destroy() but it seems its still 'playing'. any helpers? 🙂
5 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 8/24/2022 in #djs-questions
Discord.js v13.10.2, Handling with forums.
From what i understood, a forum channel is a thread so i need to use threadCreate event to notice when one is created. problem is it doesn't emit, probably because im missing an intent (most likely). would love some guidence regarding this matter or maybe the specific intent to add (full object name, for example: Intents.FLAGS.GUILDS). thanks in advance!
15 replies