mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
Rename voiceconnection.speaking to voiceconnection.memberd
This commit is contained in:
@@ -13,7 +13,7 @@ A voice channel of a server. Currently, the voice channel class has no differenc
|
|||||||
Attributes
|
Attributes
|
||||||
----------
|
----------
|
||||||
|
|
||||||
speaking
|
members
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
A Cache_ of Users_ that are speaking in the voice channel
|
A Cache_ of Users_ that are connected to the voice channel
|
||||||
@@ -181,7 +181,7 @@ var Server = (function (_Equality) {
|
|||||||
// removes from other speaking channels first
|
// removes from other speaking channels first
|
||||||
this.eventStopSpeaking(user);
|
this.eventStopSpeaking(user);
|
||||||
|
|
||||||
channel.speaking.add(user);
|
channel.members.add(user);
|
||||||
user.voiceChannel = channel;
|
user.voiceChannel = channel;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -205,8 +205,8 @@ var Server = (function (_Equality) {
|
|||||||
|
|
||||||
var chan = _ref3;
|
var chan = _ref3;
|
||||||
|
|
||||||
if (chan.speaking.has(user)) {
|
if (chan.members.has(user)) {
|
||||||
chan.speaking.remove(user);
|
chan.members.remove(user);
|
||||||
user.voiceChannel = null;
|
user.voiceChannel = null;
|
||||||
return chan;
|
return chan;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ var VoiceChannel = (function (_ServerChannel) {
|
|||||||
_classCallCheck(this, VoiceChannel);
|
_classCallCheck(this, VoiceChannel);
|
||||||
|
|
||||||
_ServerChannel.call(this, data, client, server);
|
_ServerChannel.call(this, data, client, server);
|
||||||
this.speaking = new _UtilCache2["default"]();
|
this.members = new _UtilCache2["default"]();
|
||||||
}
|
}
|
||||||
|
|
||||||
VoiceChannel.prototype.join = function join() {
|
VoiceChannel.prototype.join = function join() {
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ export default class Server extends Equality {
|
|||||||
// removes from other speaking channels first
|
// removes from other speaking channels first
|
||||||
this.eventStopSpeaking(user);
|
this.eventStopSpeaking(user);
|
||||||
|
|
||||||
channel.speaking.add(user);
|
channel.members.add(user);
|
||||||
user.voiceChannel = channel;
|
user.voiceChannel = channel;
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
@@ -160,8 +160,8 @@ export default class Server extends Equality {
|
|||||||
|
|
||||||
eventStopSpeaking(user){
|
eventStopSpeaking(user){
|
||||||
for(let chan of this.channels.getAll("type", "voice")){
|
for(let chan of this.channels.getAll("type", "voice")){
|
||||||
if(chan.speaking.has(user)){
|
if(chan.members.has(user)){
|
||||||
chan.speaking.remove(user);
|
chan.members.remove(user);
|
||||||
user.voiceChannel = null;
|
user.voiceChannel = null;
|
||||||
return chan;
|
return chan;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {reg} from "../Util/ArgumentRegulariser";
|
|||||||
export default class VoiceChannel extends ServerChannel{
|
export default class VoiceChannel extends ServerChannel{
|
||||||
constructor(data, client, server){
|
constructor(data, client, server){
|
||||||
super(data, client, server);
|
super(data, client, server);
|
||||||
this.speaking = new Cache();
|
this.members = new Cache();
|
||||||
}
|
}
|
||||||
|
|
||||||
join(callback = function () { }) {
|
join(callback = function () { }) {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ client.on("message", msg => {
|
|||||||
|
|
||||||
if (msg.content === "who is speaking") {
|
if (msg.content === "who is speaking") {
|
||||||
for (var chan of msg.channel.server.channels.getAll("type", "voice")) {
|
for (var chan of msg.channel.server.channels.getAll("type", "voice")) {
|
||||||
msg.channel.send(`${chan} : ${chan.speaking}`);
|
msg.channel.send(`${chan} : ${chan.members}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user