discord-music-player
discord-music-player copied to clipboard
[BUG] Memory usage doesn't drop
I have noticed that in my server, when the song stops the memory doesn't drop, and when I play another song the memory goes up, but never down. I have to restart the server so it doesn't overload and crash. When i login to the server after 1-2 days, the memory percentage is like 80% and nobody uses the bot.
- OS: Ubuntu 20.04.4 LTS
- Node Version: 18.4.0
- Module Version: 8.3.2
Hey, can I see your index file & play command (mostly event handler).
play command (slash):
const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = {
data: new SlashCommandBuilder()
.setName('play')
.setDescription('Plays or adds a song to the playlist.')
.addStringOption(option =>
option.setName('search')
.setDescription('Search term or url')
.setRequired(true)),
async execute(interaction, discord, client) {
interaction.ismessage = false
await interaction.deferReply()
if (!interaction.member.voice.channel) {
interaction.editReply("You must be in a voice channel to use this!")
return
}
args = interaction.options.getString('search');
console.log(args)
let queue = client.player.getQueue(interaction.guild.id);
if (queue == null) queue = client.player.createQueue(interaction.guild.id);
queue.setData({
'message': interaction
})
if (args.search("/playlist") !== -1) {
await queue.join(interaction.member.voice.channel)
let song = await queue.playlist(args
).catch(err=>{
interaction.editReply("No playlist was found!")
})
} else {
await queue.join(interaction.member.voice.channel)
await queue.play(args).catch(err => {interaction.editReply("No song with that name was found"); console.log(err)})
}
},
};
What do you mean event handler, which one?
cnr, can you provide a source url?