Spookadia
Spookadia
DIAdiscord.js - Imagine an app
Created by Spookadia on 10/3/2023 in #djs-questions
Fetching thread from Forum Channel Message
For some reason I'm having trouble fetching the thread from a forum channel's message. I'm listening for reactions, but reaction.message.hasThread always returns false, even after running reaction.message.fetch(). The message type is also always Default instead of ThreadStarterMessage. Any idea what might be going on?
7 replies
DIAdiscord.js - Imagine an app
Created by Spookadia on 8/19/2023 in #djs-questions
Best way to handle ready event failure
Recently my bot had a lot of downtime because it auto-restarted but never got properly readied; it seems it silently errored with a RequestAbortedError. What's the best way to handle something happening like that? When it errored it never fired the ready event and put the bot into a do-nothing limbo until I manually restarted it. Is there an event I should listen to, or just a generic timeout I should set to see if it readied properly?
12 replies
DIAdiscord.js - Imagine an app
Created by Spookadia on 7/5/2023 in #djs-voice
AudioResource not playing on Linux
I have a strange issue that I would assume is a dependency mismatch, however everything is in check. I play a URL audio source on my bot that will work on Windows but not on Linux; no errors occur, the audio resource just never plays.
let resource = createAudioResource(song.track.preview_url) //Something like p.scdn.co/mp3-preview/8129d5338c56d78f5712fc95d246198da5261854?cid=4c5368cfdc084da795955dd07534fa1e
audioplayer.play(resource)
console.log(song.track.preview_url)
console.log(resource.playbackDuration)
console.log(resource.read())
let resource = createAudioResource(song.track.preview_url) //Something like p.scdn.co/mp3-preview/8129d5338c56d78f5712fc95d246198da5261854?cid=4c5368cfdc084da795955dd07534fa1e
audioplayer.play(resource)
console.log(song.track.preview_url)
console.log(resource.playbackDuration)
console.log(resource.read())
playbackDuration is 0 and .read() returns null. No AudioPlayer error events (or errors in general) are emitted, all the dependencies project-wise are the same, and this resource does work on my own Windows PC. I've also double checked the resource is downloadable from my VPS. The url points to an mp3 file, so ffmpeg-static is being used. Below is the dependency list:
Core Dependencies
- @discordjs/voice: 0.16.0
- prism-media: 1.3.5

Opus Libraries
- @discordjs/opus: 0.9.0
- opusscript: not found

Encryption Libraries
- sodium-native: 4.0.4
- sodium: not found
- libsodium-wrappers: not found
- tweetnacl: not found

FFmpeg
- version: 5.0.1-static https://johnvansickle.com/ffmpeg/
- libopus: yes
Core Dependencies
- @discordjs/voice: 0.16.0
- prism-media: 1.3.5

Opus Libraries
- @discordjs/opus: 0.9.0
- opusscript: not found

Encryption Libraries
- sodium-native: 4.0.4
- sodium: not found
- libsodium-wrappers: not found
- tweetnacl: not found

FFmpeg
- version: 5.0.1-static https://johnvansickle.com/ffmpeg/
- libopus: yes
11 replies
DIAdiscord.js - Imagine an app
Created by Spookadia on 12/19/2022 in #djs-questions
Dev Environment with Sharding
Hey, I'm about to start working on getting my bot ready for sharding, but I'm not sure how to go about creating the environment on my development bot. Any tips?
9 replies
DIAdiscord.js - Imagine an app
Created by Spookadia on 9/19/2022 in #djs-questions
.setActivity() stops events from firing
I know, I'm really confused too. On my windows machine everything works perfectly, but on my Linux VPS I've pinpointed (through commenting and uncommenting) the following line of code disables all of my .on and .once event calls:
await client.user.setActivity("/help | " + hours + ":" + minutes + " left", {type: ActivityType.Listening})
await client.user.setActivity("/help | " + hours + ":" + minutes + " left", {type: ActivityType.Listening})
Only that line is commented. If I uncomment it, it is run on the ready event and prevents any other events from firing henceforth. ..Any idea why?
7 replies