#How to make my radio bot run smoother?
20 messages · Page 1 of 1 (latest)
try sharding
@magic comet
If you're concerned about lagging and your current setup is already facing issues, then your logic may be horribly flawed.
What you need to ensure is that your host machine has a stable internet connection and has a reasonably good cpu capable of decoding and encoding audio in realtime. Bonus points if the cpu has multiple cores, because you can abuse worker_threads.
You can try to create a good working system yourself, or I'd probably recommend using or referencing from https://github.com/AmandaDiscord/Volcano
specifically: https://github.com/AmandaDiscord/Volcano/blob/main/src/worker.ts
I think you really glossed over the actually important info. If you're having issues currently, then either your host machine is e-waste or your code is bad. In either case, I wouldn't recommend focusing your efforts towards music related stuff since to get good audio playback, it takes a lot of balancing, research, and science.
If you're a beginner at this kind of stuff, I would REALLY recommend taking a look at solutions similar to or literally just using LavaLink. The general take away concept is that you should be able to distribute your audio processing to multiple host machines and have it be de-coupled from your bot's logic especially with slash commands as the cpu time is better diverted to processing and routing interactions so they don't expire before you can even respond to them. Audio processing takes up way too much cpu time currently and the entire music space is just really high maintenance and requires a pretty good amount of knowledge.
Do with that info as you will and even ignore me if you think I'm wrong, but know that you are getting into a really deep and complicated rabbit hole.
I use Azuri with sharding, so ehm i think this is it?
manager.on('shardCreate', shard => console.log(`Starting Shard: ${shard.id}`));
manager.spawn();
i see this in the app.js.
at the end.
https://github.com/TwixGamer00/azuri
this is the github, i've customized the bot to my own xd
but at app.js and index.js i didn't changed anything or at least not much.
@winged zenith
ok i see it's just working
but when counts it up?
i've seen much vids and it always said: started shard 0
not 1 or 5 or any other number, when does it do?
ping me.
You don't have to worry about sharding so early. Sharding is only beneficial at 1500+ guilds which you are a long ways away. The ShardingManager's default behavior is to tell Discord to spawn however many shards it thinks are appropriate for your bot
ehm it "asks" the voice of the radio. and that can lagg a lot xd
What cpu does your host machine have
arm64
it's an raspberrypi 4B wich runs the station also.
my second is an older one, an pentium 3, i've got it as gift from my grandma, because she didn't used it since it was used as office pc and home pc later.
my main pc has core i 5 6th gen
