Discord.js: 'voiceStateUpdate' not detects selfMute.

Created on 25 Sep 2017  路  4Comments  路  Source: discordjs/discord.js

When the Bot and I are in a VoiceChannel, I mute myself (not serverwide) console.log('2'); is not triggered. "ja" is not triggered too. Why?

meme = "123DISCORD ID";
function _podoff() {
    if (_voiceReceivers.get(kanal)) {
        _voiceReceivers.get(kanal).destroy();
        _voiceReceivers.delete(kanal);
        _voiceConnections.get(kanal).disconnect();
        _voiceConnections.delete(kanal);
    }
}
function _onReady() {
    console.log('Ready!');

    _podon();
}

function muted(oldMember, newMember) {
 console.log("ja");
 if (oldMember.selfMute == false && newMember.selfMute == true) {
     console.log('2');
     if (newMember.id == meme) {
        console.log('3');
        _podoff();
        process.exit(0);     

     }
 }
}

function error(e) {
    console.log(e.stack);
    process.exit(0);
}

const client = new Discord.Client();
const _voiceConnections = new Map();
const _voiceReceivers = new Map();
const _writeStreams = new Map();
client.on('ready', _onReady.bind(this));
client.on('voiceStateUpdate', muted.bind(this));
client.on('guildMemberSpeaking', _onGuildMemberSpeaking.bind(this));
client.login(TOKEN).catch(console.error);

If I leave the channel for example console.log("ja"); is triggered.

medium unverified voice bug

Most helpful comment

I don't need to fill out the form anymore, because the problem has been solved by your code, thank you! Everything seems to work now.

All 4 comments

Could you please fill out the issue template so we can start investigating this?

See here for the template.

Edit: I've just attempted this with your code (took out the functions though) and it worked on the latest master hash (At the time of writing 1537dd7be758dab0b7684f3dcd618b6ef05a72bd). It logged ja when I joined a VoiceChannel, again logged ja when I selfmuted myself and in addition logged 2 because I was previously not self-muted and now am, aswell as logging 3 because the new member's ID equaled mine.

client.on('voiceStateUpdate', (oldMember, newMember) => {
    console.log('ja');
    if (oldMember.selfMute === false && newMember.selfMute === true) {
        console.log('2');
        if (newMember.id === '108988529383616512') {
            console.log('3');
        }
    }
});

I don't need to fill out the form anymore, because the problem has been solved by your code, thank you! Everything seems to work now.

The issue isn't solved. Now I never get console.log("ja");
Version: [email protected] Windows64 / node.js v8.4.0 / selfbot

Magicly now it works

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DatMayo picture DatMayo  路  3Comments

shukriadams picture shukriadams  路  3Comments

Dmitry221060 picture Dmitry221060  路  3Comments

Dmitry221060 picture Dmitry221060  路  3Comments

ghost picture ghost  路  3Comments