I'm doing a very simple BOT for discord where basically it will play my shoutcast radio in a room on the discord.
Code:
client.on('message', message => {
let args = message.content.substring(1).split(' ')
if (args[0] === 'play') {
connected = message.member.voice.channel.join().then(
connection => {
connected = connection.play('http://mystation.com/stream.mp3')
}
)
}
})
Basically the user will enter an audio room and type !play and the bot will enter that room to start playing the radio
It normally plays the radio, but the audio is constantly locking up and I noticed that there is high consumption of RAM only with this code, it is exceeding 100 MB. Does anyone have any suggestions or optimization tips to reduce this excess RAM? I would like to understand why this occurs