mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
start work with broadcast streams
This commit is contained in:
@@ -11,6 +11,7 @@ const ActionsManager = require('./actions/ActionsManager');
|
||||
const Collection = require('../util/Collection');
|
||||
const Presence = require('../structures/Presence').Presence;
|
||||
const ShardClientUtil = require('../sharding/ShardClientUtil');
|
||||
const VoiceBroadcast = require('./voice/VoiceBroadcast');
|
||||
|
||||
/**
|
||||
* The starting point for making a Discord Bot.
|
||||
@@ -136,6 +137,12 @@ class Client extends EventEmitter {
|
||||
*/
|
||||
this.readyAt = null;
|
||||
|
||||
/**
|
||||
* An array of voice broadcasts
|
||||
* @type {VoiceBroadcast[]}
|
||||
*/
|
||||
this.broadcasts = [];
|
||||
|
||||
/**
|
||||
* The previous heartbeat pings of the websocket (most recent first, limited to three elements)
|
||||
* @type {number[]}
|
||||
@@ -219,6 +226,12 @@ class Client extends EventEmitter {
|
||||
return typeof window !== 'undefined';
|
||||
}
|
||||
|
||||
createVoiceBroadcast() {
|
||||
const broadcast = new VoiceBroadcast(this);
|
||||
this.broadcasts.push(broadcast);
|
||||
return broadcast;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs the client in. If successful, resolves with the account's token. <warn>If you're making a bot, it's
|
||||
* much better to use a bot account rather than a user account.
|
||||
|
||||
Reference in New Issue
Block a user