#Bot that mutes for some time

22 messages · Page 1 of 1 (latest)

keen martenBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

brittle hound
#

`node is 18

#

discord is latest

acoustic mist
#

store the users they mute in a collection, when the time expires, iterate through the collection and unmute them

brittle hound
#

how can i iknow which user they mute ?

brittle hound
#

i cant put a timeout in the command's file otherwise it wouldn't answer ?

acoustic mist
#

just use settimeout

acoustic mist
sudden gullBOT
brittle hound
#

what if i want the array of members of the server

#
const { SlashCommandBuilder } = require("discord.js");

module.exports = {
  data: new SlashCommandBuilder()
    .setName("ping")
    .setDescription("Replies with Pong!"),
  async execute(interaction) {
    await interaction.guild.members.fetch().then(l=>{for (e of l) {
        console.log(e.username);
    }})
    // await interaction.reply("Pong!");
  },
};

#

and will i be able to control the voice params

acoustic mist
#

voice params?

brittle hound
#

like setDeaf setMute

brittle hound
acoustic mist
#

you can only control voice when the member is in a voice channel iirc, not entirely sure

brittle hound
#

yes this is correct

#

i was thinking of using exceptions

acoustic mist
#

well, then you'll need the GuildVoiceStates intent

#

and do note if you deafen a member and they leave the vc i dont think you can unmute them when they arent in voice

brittle hound
#

lol i was just missing the intent