fix: opcode 24 (Interaction search function)
Todo: Rewrite slash command ...
This commit is contained in:
@@ -2,14 +2,10 @@
|
||||
const { Events } = require('../../../util/Constants');
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
if (!data.application_commands[0]) return;
|
||||
for (const command of data.application_commands) {
|
||||
const user = client.users.cache.get(command.application_id);
|
||||
if (!user) continue;
|
||||
if (!user || !user.bot) continue;
|
||||
user.applications._add(command, true);
|
||||
}
|
||||
client.emit(
|
||||
Events.GUILD_APPLICATION_COMMANDS_UPDATE,
|
||||
client.users.cache.get(data.application_commands[0].application_id).applications.cache,
|
||||
);
|
||||
client.emit(Events.GUILD_APPLICATION_COMMANDS_UPDATE, data);
|
||||
};
|
||||
|
@@ -11,7 +11,7 @@ module.exports = (client, { d: data }) => {
|
||||
* Emitted whenever a relationship is updated.
|
||||
* @event Client#relationshipAdd
|
||||
* @param {Snowflake} user The userID that was updated
|
||||
* @param {RelationshipTypes} type The new relationship type (String)
|
||||
* @param {RelationshipTypes} type The new relationship type
|
||||
*/
|
||||
client.emit(Events.RELATIONSHIP_ADD, data.id, RelationshipTypes[data.type]);
|
||||
};
|
||||
|
@@ -1,13 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
const { Events } = require('../../../util/Constants');
|
||||
const { Events, RelationshipTypes } = require('../../../util/Constants');
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
client.relationships.cache.delete(data.id);
|
||||
/**
|
||||
* Emitted whenever a relationship is updated.
|
||||
* Emitted whenever a relationship is delete.
|
||||
* @event Client#relationshipRemove
|
||||
* @param {Snowflake} user The userID that was updated
|
||||
* @param {RelationshipTypes} type The type of the old relationship
|
||||
*/
|
||||
client.emit(Events.RELATIONSHIP_REMOVE, data.id);
|
||||
client.emit(Events.RELATIONSHIP_REMOVE, data.id, RelationshipTypes[data.type]);
|
||||
};
|
||||
|
Reference in New Issue
Block a user