#music bot

1 messages · Page 1 of 1 (latest)

glad ice
#

how to make music bot 24/7 joined in vc channel

#

@tribal pier

#

@ruby spruce @ruby spruce

#

the music bot leave vc after user leave

#

how to make it stay in vc 24/7

tribal pier
#

Edit the code add 24/7 feature what else

ruby spruce
#

yes

glad ice
glad ice
tribal pier
glad ice
#

this ?

glad ice
tribal pier
#

Ye

glad ice
cerulean bramble
glad ice
#

its leave after 5hour

#

@tribal pier its not sec

#

i give 1year sec

#

it leave after 5hour 😭

tribal pier
glad ice
glad ice
glad ice
cerulean bramble
glad ice
#

😉

cerulean bramble
tribal pier
#

^^ 💯

glad ice
glad ice
bronze violetBOT
#

⚠️ You must accept these rules to use the bot!
This message is now inactive.

OwO Bot Rules
Failure to follow these rules will result in a ban and/or account reset!

• Any actions performed to gain an unfair advantage over other users are explicitly against the rules. This includes but not limited to:
├> Using macros/scripts for any commands
└> Using multiple accounts for any reason

• Do not use any exploits and report any found in the bot

• You can not sell/trade cowoncy or any bot goods for anything outside of the bot

• If you have any questions come ask us in our server!

Privacy Policy - Terms of Service

Clicking on the button means you will follow the rules and acknowlege the consequences

tribal pier
#

Just send him whole code gng or use another ai

glad ice
#

its milli sec

glad ice
#

lol

glad ice
tribal pier
#

Cuz I've 69 projects going on

#

Besides that was more than a month ago

glad ice
#

put this for 365 days

cerulean bramble
glad ice
#

@tribal pier i puth this time but bot leave after 1sec 💀

tribal pier
glad ice
# tribal pier Copy Open chatgpt Paste

ChatGPT said:

Here’s what the snippet is doing, broken down clearly:

aloneTimeouts.delete(guild.id);

}, 31536000000);

aloneTimeouts.set(guild.id, timeout);

What’s happening overall

This code is managing a timeout associated with a specific guild (server) using a Map called aloneTimeouts.

It does these things:

✅ 1. It creates a timeout that will run after a VERY long time

31536000000 milliseconds
= 31,536,000,000 ms
= 365 days (1 year)

So the callback function will run in one year.

✅ 2. Inside the timeout, it removes the guild’s timeout entry
aloneTimeouts.delete(guild.id);

This means:

When the timeout finishes (after 1 year),

The bot will remove this guild's ID from the aloneTimeouts map.

This prevents memory leaks by clearing old entries.

✅ 3. It stores the timeout in a Map
aloneTimeouts.set(guild.id, timeout);

This associates the created timeout with the guild ID, so the bot can:

cancel it later if needed

check whether it already exists

manage guild-specific actions

Example:
If the bot tracks when a music player is alone in a voice channel, it may set a “leave after X time” timeout.

🔍 What this pattern is commonly used for

This pattern is typical in Discord music bots to:

leave a voice channel after being alone too long

clear memory or cache for inactive guilds

run cleanup operations long after something happens

⚠️ Something odd: The timeframe is 1 year

If intentional → okay.
But most bots use something like 1–10 minutes, not ~365 days.

If it's meant to be something like “30 minutes,” the number should be:

30 minutes → 1800000

1 hour → 3600000

#

@tribal pier its say right but not working

tribal pier
glad ice
#

but your code broken after this

tribal pier
#

😭

glad ice
tribal pier
glad ice
glad ice
#

its work

glad ice
#

and work

#

W

#

const { Events, ContainerBuilder, TextDisplayBuilder, MessageFlags } = require('discord.js');
const emojis = require('../emojis.json');

const aloneTimeouts = new Map();

module.exports = {
name: Events.VoiceStateUpdate,
async execute(oldState, newState) {
const client = newState.client || oldState.client;
const guild = newState.guild;
const player = client.poru.players.get(guild.id);

    if (!player) return;

    // If the bot disconnects, reconnect (depending on your join logic)
    if (newState.id === client.user.id) {
        if (!newState.channelId) {
            // DO NOT destroy player
            // DO NOT clear queue
            // Bot stays alive 24/7
            return;
        }
    }

    // If bot is alone in channel → do nothing (24/7 mode)
    const voiceChannel = guild.channels.cache.get(player.voiceChannel);
    if (!voiceChannel) return;

    const members = voiceChannel.members.filter(m => !m.user.bot);

    if (members.size === 0) {
        // 24/7 mode: no auto-leave
        return;
    }
},

};

glad ice
#

in /home/container/AeroX/events/voiceStateUpdate.js

#

@tribal pier tysm ❤️

tribal pier
glad ice
#

❤️

glad ice
tribal pier
#

💀

glad ice
#

if you dont say then i cant solve this

glad ice
tribal pier
#

fine

glad ice
#

its like helped doing nothing

tribal pier
tribal pier