Discord.js: GuildMember#speaking isn't accessible unless the bot is in the channel.

Created on 4 May 2018  Â·  5Comments  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
N/A

Include a reproducible code sample here, if possible:
N/A

Further details:

  • Basically, GuildMember#speaking isn't accessable unless the bot is in the channel; but still returns false. I feel it'd be best to check if the bot has the same channel the member, and if not, return null.

  • discord.js version: Master

  • node.js version: N/A
  • Operating system: N/A
  • Priority this issue should have – please be realistic and elaborate if possible:
    Low
  • [ ] I found this issue while running code on a __user account__
  • [ ] I have also tested the issue on latest master, commit hash:
fixed on master utility discussion enhancement

Most helpful comment

I can see the use in it as returning null would mean you can differentiate between "definitely not talking" and "might be talking", while still being able to use it as it is now. Either way, we should make a note of the current behaviour in docs anyway.

All 5 comments

If its false or null doesnt really make a difference. IMO there is no reason that the lib should return null if the bot isnt in the same channel as a member.... returning false just means hes either not talking OR that the bot cant see it cause hes not in the same channel.

I already explained this a couple hours ago and he said he'll close it 🤔.

I can see the use in it as returning null would mean you can differentiate between "definitely not talking" and "might be talking", while still being able to use it as it is now. Either way, we should make a note of the current behaviour in docs anyway.

Hi, I added this in the above commit :smile:

If the client isn't aware of whether the member is speaking, then member.speaking === undefined, otherwise it will be true/false depending on whether the member is speaking.

This information is only available if the client is connected to any voice channel in a guild.

Wonderful! Didn't realise it was if the client is in ANY channel - perhaps make that a little more clear in the documentation?

  /**
   * Whether this member is speaking. If the client isn't connected to a channel within the guild, then this will be undefined. Otherwise it will be
   * true/false
   * @type {?boolean}
   * @name GuildMember#speaking
   */

Something like that I feel might be a little more clear. Thanks Hydra! (:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shukriadams picture shukriadams  Â·  3Comments

kvn1351 picture kvn1351  Â·  3Comments

DatMayo picture DatMayo  Â·  3Comments

xCuzImPro picture xCuzImPro  Â·  3Comments

Acaretia picture Acaretia  Â·  3Comments