#How can I turn off the microphone on the bot itself?
62 messages · Page 1 of 1 (latest)
• 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.
Pass selfMute: true option
can you tell me what you are in
now i'm using this
but how can i turn it on and off with the help of a command
@summer valve do you have any knowledge
create slash commands for mute and unmute via the SlashCommandBuilder
i can't explain myself my english is very bad
how can i do this as command
You do not understand me
I mean how can I use selfmute outside of joinVoiceChannel
why do want that as a command? cant you just server mute the bot?
Actually, I do not use it for command, for example, I will turn on the bota mute when someone enters the sound, but I have no idea how to do this.
so
selfMute: false
so you want the bot to selfMute whenever someone plays a sound? did I get that right?
yeah
I don't get why you would want to do that but I guess you would have to get the ID of every command which allows the bot to play something when he is in a channel.. yk?
yes how can i get it can you help me
probably width the ApplicationCommand.id Docs: https://old.discordjs.dev/#/docs/discord.js/14.9.0/class/ApplicationCommand?scrollTo=id
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
no this is not what i'm looking for
CommandInteraction Docs: https://old.discordjs.dev/#/docs/discord.js/14.9.0/class/CommandInteraction
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
on how to get the id of the command for the bot to selfMute or not?
yes but what does that have to do with CommandInteraction
this is my voice connect event
I want the bot to mute when the voice update is done, that's all
selfMute: false
I'm going to write now
but I don't know how to selfMute false
me neither, I don't get what you want
how do i make selfmute false
set it to false
yes but how can i do that
client.on("*", async (oldState, newState) => { set.newState.selfMute: false; });
or something like that
then idk sry
np
Documentation suggestion for @late merlin:
VoiceState#setMute()
Mutes/unmutes the member of this voice state.
@summer valve Doesn't that just tell us whether it's true or false?
No, it literally sets it. That’s why it‘s called setMute and is a function
Isn't that supposed to happen?
but it didn't work
That will mute every person that ever joins/leaves/mutes/unmutes/deafens/undeafens in any VoiceChannel your bot can see and manage… I doubt that‘s what you intend it to do. Don‘t do it in voiceStateUpdate event…
Also check you actually have GuildVoiceStates intent
I just want to self mute my own bot
these are my codes
<Guild>.members.me.voice.setMute(false) or true if you want to mute it
I want it to turn on the mute when there is an update in the audio
I am trying
Then you need to listen to the VoiceReceiver‘s SpeakingMap‘s event and mute there
can you give an example
https://github.com/discordjs/voice-examples/tree/main/recorder has an example on how to do something (in their case record) when someone sends audio