refactor: remove all voice code (#5818)

* refactor: remove all voice code

* refactor: remove even more remnants
This commit is contained in:
Antonio Román
2021-06-12 00:21:34 +02:00
committed by GitHub
parent 93b0a4e005
commit fdef940127
5 changed files with 0 additions and 117 deletions

View File

@@ -25,7 +25,6 @@ module.exports = {
MessageFlags: require('./util/MessageFlags'),
Intents: require('./util/Intents'),
Permissions: require('./util/Permissions'),
Speaking: require('./util/Speaking'),
SnowflakeUtil: require('./util/SnowflakeUtil'),
Structures: require('./util/Structures'),
SystemChannelFlags: require('./util/SystemChannelFlags'),

View File

@@ -385,7 +385,6 @@ class GuildMember extends Base {
guild: 'guildID',
user: 'userID',
displayName: true,
speaking: false,
lastMessage: false,
lastMessageID: false,
roles: true,

View File

@@ -203,23 +203,6 @@ exports.Status = {
RESUMING: 8,
};
/**
* The current status of a voice connection. Here are the available statuses:
* * CONNECTED: 0
* * CONNECTING: 1
* * AUTHENTICATING: 2
* * RECONNECTING: 3
* * DISCONNECTED: 4
* @typedef {number} VoiceStatus
*/
exports.VoiceStatus = {
CONNECTED: 0,
CONNECTING: 1,
AUTHENTICATING: 2,
RECONNECTING: 3,
DISCONNECTED: 4,
};
exports.OPCodes = {
DISPATCH: 0,
HEARTBEAT: 1,
@@ -235,18 +218,6 @@ exports.OPCodes = {
HEARTBEAT_ACK: 11,
};
exports.VoiceOPCodes = {
IDENTIFY: 0,
SELECT_PROTOCOL: 1,
READY: 2,
HEARTBEAT: 3,
SESSION_DESCRIPTION: 4,
SPEAKING: 5,
HELLO: 8,
CLIENT_CONNECT: 12,
CLIENT_DISCONNECT: 13,
};
exports.Events = {
RATE_LIMIT: 'rateLimit',
INVALID_REQUEST_WARNING: 'invalidRequestWarning',
@@ -262,7 +233,6 @@ exports.Events = {
GUILD_MEMBER_REMOVE: 'guildMemberRemove',
GUILD_MEMBER_UPDATE: 'guildMemberUpdate',
GUILD_MEMBER_AVAILABLE: 'guildMemberAvailable',
GUILD_MEMBER_SPEAKING: 'guildMemberSpeaking',
GUILD_MEMBERS_CHUNK: 'guildMembersChunk',
GUILD_INTEGRATIONS_UPDATE: 'guildIntegrationsUpdate',
GUILD_ROLE_CREATE: 'roleCreate',
@@ -291,8 +261,6 @@ exports.Events = {
PRESENCE_UPDATE: 'presenceUpdate',
VOICE_SERVER_UPDATE: 'voiceServerUpdate',
VOICE_STATE_UPDATE: 'voiceStateUpdate',
VOICE_BROADCAST_SUBSCRIBE: 'subscribe',
VOICE_BROADCAST_UNSUBSCRIBE: 'unsubscribe',
TYPING_START: 'typingStart',
WEBHOOKS_UPDATE: 'webhookUpdate',
INTERACTION_CREATE: 'interaction',

View File

@@ -1,39 +0,0 @@
'use strict';
const BitField = require('./BitField');
/**
* Data structure that makes it easy to interact with a {@link VoiceConnection#speaking}
* and {@link guildMemberSpeaking} event bitfields.
* @extends {BitField}
*/
class Speaking extends BitField {}
/**
* @name Speaking
* @kind constructor
* @memberof Speaking
* @param {BitFieldResolvable} [bits=0] Bit(s) to read from
*/
/**
* Bitfield of the packed bits
* @type {number}
* @name Speaking#bitfield
*/
/**
* Numeric speaking flags. All available properties:
* * `SPEAKING`
* * `SOUNDSHARE`
* * `PRIORITY_SPEAKING`
* @type {Object}
* @see {@link https://discord.com/developers/docs/topics/voice-connections#speaking}
*/
Speaking.FLAGS = {
SPEAKING: 1 << 0,
SOUNDSHARE: 1 << 1,
PRIORITY_SPEAKING: 1 << 2,
};
module.exports = Speaking;

44
typings/index.d.ts vendored
View File

@@ -536,7 +536,6 @@ declare module 'discord.js' {
GUILD_MEMBER_REMOVE: 'guildMemberRemove';
GUILD_MEMBER_UPDATE: 'guildMemberUpdate';
GUILD_MEMBER_AVAILABLE: 'guildMemberAvailable';
GUILD_MEMBER_SPEAKING: 'guildMemberSpeaking';
GUILD_MEMBERS_CHUNK: 'guildMembersChunk';
GUILD_INTEGRATIONS_UPDATE: 'guildIntegrationsUpdate';
GUILD_ROLE_CREATE: 'roleCreate';
@@ -563,8 +562,6 @@ declare module 'discord.js' {
PRESENCE_UPDATE: 'presenceUpdate';
VOICE_SERVER_UPDATE: 'voiceServerUpdate';
VOICE_STATE_UPDATE: 'voiceStateUpdate';
VOICE_BROADCAST_SUBSCRIBE: 'subscribe';
VOICE_BROADCAST_UNSUBSCRIBE: 'unsubscribe';
TYPING_START: 'typingStart';
WEBHOOKS_UPDATE: 'webhookUpdate';
INTERACTION_CREATE: 'interaction';
@@ -647,24 +644,6 @@ declare module 'discord.js' {
HEARTBEAT_ACK: 11;
};
APIErrors: APIErrors;
VoiceStatus: {
CONNECTED: 0;
CONNECTING: 1;
AUTHENTICATING: 2;
RECONNECTING: 3;
DISCONNECTED: 4;
};
VoiceOPCodes: {
IDENTIFY: 0;
SELECT_PROTOCOL: 1;
READY: 2;
HEARTBEAT: 3;
SESSION_DESCRIPTION: 4;
SPEAKING: 5;
HELLO: 8;
CLIENT_CONNECT: 12;
CLIENT_DISCONNECT: 13;
};
ChannelTypes: typeof ChannelTypes;
ClientApplicationAssetTypes: {
SMALL: 1;
@@ -738,7 +717,6 @@ declare module 'discord.js' {
constructor(client: Client, data: unknown);
private _sortedRoles(): Collection<Snowflake, Role>;
private _sortedChannels(channel: Channel): Collection<Snowflake, GuildChannel>;
private _memberSpeakUpdate(user: Snowflake, speaking: boolean): void;
public readonly afkChannel: VoiceChannel | null;
public afkChannelID: Snowflake | null;
@@ -1721,11 +1699,6 @@ declare module 'discord.js' {
public static readonly EPOCH: number;
}
export class Speaking extends BitField<SpeakingString> {
public static FLAGS: Record<SpeakingString, number>;
public static resolve(bit?: BitFieldResolvable<SpeakingString, number>): number;
}
export class StageChannel extends BaseGuildVoiceChannel {
public topic: string | null;
public type: 'stage';
@@ -2631,7 +2604,6 @@ declare module 'discord.js' {
guild: Guild,
data: { count: number; index: number; nonce: string | undefined },
];
guildMemberSpeaking: [member: GuildMember | PartialGuildMember, speaking: Readonly<Speaking>];
guildMemberUpdate: [oldMember: GuildMember | PartialGuildMember, newMember: GuildMember];
guildUpdate: [oldGuild: Guild, newGuild: Guild];
inviteCreate: [invite: Invite];
@@ -3677,20 +3649,6 @@ declare module 'discord.js' {
public readonly url: string;
}
interface StreamOptions {
type?: StreamType;
seek?: number;
volume?: number | boolean;
plp?: number;
fec?: boolean;
bitrate?: number | 'auto';
highWaterMark?: number;
}
type SpeakingString = 'SPEAKING' | 'SOUNDSHARE' | 'PRIORITY_SPEAKING';
type StreamType = 'unknown' | 'converted' | 'opus' | 'ogg/opus' | 'webm/opus';
type SystemChannelFlagsString =
| 'SUPPRESS_JOIN_NOTIFICATIONS'
| 'SUPPRESS_PREMIUM_SUBSCRIPTIONS'
@@ -3732,8 +3690,6 @@ declare module 'discord.js' {
type VerificationLevel = 'NONE' | 'LOW' | 'MEDIUM' | 'HIGH' | 'VERY_HIGH';
type VoiceStatus = number;
type WebhookClientOptions = Pick<
ClientOptions,
'allowedMentions' | 'restTimeOffset' | 'restRequestTimeout' | 'retryLimit' | 'http'