mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
fix(Structures): remove Structures (#6027)
This commit is contained in:
@@ -10,6 +10,7 @@ const ChannelManager = require('../managers/ChannelManager');
|
||||
const GuildManager = require('../managers/GuildManager');
|
||||
const UserManager = require('../managers/UserManager');
|
||||
const ShardClientUtil = require('../sharding/ShardClientUtil');
|
||||
const ClientPresence = require('../structures/ClientPresence');
|
||||
const GuildPreview = require('../structures/GuildPreview');
|
||||
const GuildTemplate = require('../structures/GuildTemplate');
|
||||
const Invite = require('../structures/Invite');
|
||||
@@ -22,7 +23,6 @@ const DataResolver = require('../util/DataResolver');
|
||||
const Intents = require('../util/Intents');
|
||||
const Options = require('../util/Options');
|
||||
const Permissions = require('../util/Permissions');
|
||||
const Structures = require('../util/Structures');
|
||||
|
||||
/**
|
||||
* The main hub for interacting with the Discord API, and the starting point for any bot.
|
||||
@@ -119,7 +119,6 @@ class Client extends BaseClient {
|
||||
*/
|
||||
this.channels = new ChannelManager(this);
|
||||
|
||||
const ClientPresence = Structures.get('ClientPresence');
|
||||
/**
|
||||
* The presence of the Client
|
||||
* @private
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
const Action = require('./Action');
|
||||
const ButtonInteraction = require('../../structures/ButtonInteraction');
|
||||
const CommandInteraction = require('../../structures/CommandInteraction');
|
||||
const SelectMenuInteraction = require('../../structures/SelectMenuInteraction');
|
||||
const { Events, InteractionTypes, MessageComponentTypes } = require('../../util/Constants');
|
||||
const Structures = require('../../util/Structures');
|
||||
|
||||
let deprecationEmitted = false;
|
||||
|
||||
@@ -16,15 +18,15 @@ class InteractionCreateAction extends Action {
|
||||
let InteractionType;
|
||||
switch (data.type) {
|
||||
case InteractionTypes.APPLICATION_COMMAND:
|
||||
InteractionType = Structures.get('CommandInteraction');
|
||||
InteractionType = CommandInteraction;
|
||||
break;
|
||||
case InteractionTypes.MESSAGE_COMPONENT:
|
||||
switch (data.data.component_type) {
|
||||
case MessageComponentTypes.BUTTON:
|
||||
InteractionType = Structures.get('ButtonInteraction');
|
||||
InteractionType = ButtonInteraction;
|
||||
break;
|
||||
case MessageComponentTypes.SELECT_MENU:
|
||||
InteractionType = Structures.get('SelectMenuInteraction');
|
||||
InteractionType = SelectMenuInteraction;
|
||||
break;
|
||||
default:
|
||||
client.emit(
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
const Action = require('./Action');
|
||||
const VoiceState = require('../../structures/VoiceState');
|
||||
const { Events } = require('../../util/Constants');
|
||||
const Structures = require('../../util/Structures');
|
||||
|
||||
class VoiceStateUpdate extends Action {
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const guild = client.guilds.cache.get(data.guild_id);
|
||||
if (guild) {
|
||||
const VoiceState = Structures.get('VoiceState');
|
||||
// Update the state
|
||||
const oldState =
|
||||
guild.voiceStates.cache.get(data.user_id)?._clone() ?? new VoiceState(guild, { user_id: data.user_id });
|
||||
|
||||
Reference in New Issue
Block a user