#Bot that mutes for some time
22 messages · Page 1 of 1 (latest)
store the users they mute in a collection, when the time expires, iterate through the collection and unmute them
how can i iknow which user they mute ?
also how do i treat "when time expires"
i cant put a timeout in the command's file otherwise it wouldn't answer ?
just use settimeout
by listening for the guildMemberUpdate event
GuildMember#isCommunicationDisabled()
Whether this member is currently timed out
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
voice params?
like setDeaf setMute
i dont understand why this doesnt work either
you can only control voice when the member is in a voice channel iirc, not entirely sure
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
lol i was just missing the intent