fix(searchInteraction): Support enums
This commit is contained in:
parent
2edf7428d8
commit
0963ab28e0
@ -34,6 +34,7 @@ const {
|
|||||||
PremiumTiers,
|
PremiumTiers,
|
||||||
Opcodes,
|
Opcodes,
|
||||||
Events,
|
Events,
|
||||||
|
ApplicationCommandTypes,
|
||||||
} = require('../util/Constants');
|
} = require('../util/Constants');
|
||||||
const DataResolver = require('../util/DataResolver');
|
const DataResolver = require('../util/DataResolver');
|
||||||
const SnowflakeUtil = require('../util/SnowflakeUtil');
|
const SnowflakeUtil = require('../util/SnowflakeUtil');
|
||||||
@ -655,7 +656,13 @@ class Guild extends AnonymousGuild {
|
|||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
this.client.removeListener(Events.GUILD_APPLICATION_COMMANDS_UPDATE, handler);
|
this.client.removeListener(Events.GUILD_APPLICATION_COMMANDS_UPDATE, handler);
|
||||||
this.client.decrementMaxListeners();
|
this.client.decrementMaxListeners();
|
||||||
resolve(this.client.users.cache.get(botId)?.applications?.cache?.find(c => c.name === query && c.type == type));
|
resolve(
|
||||||
|
this.client.users.cache
|
||||||
|
.get(botId)
|
||||||
|
?.applications?.cache?.find(
|
||||||
|
c => (c.name === query && c.type == type) || c.type == ApplicationCommandTypes[type],
|
||||||
|
),
|
||||||
|
);
|
||||||
};
|
};
|
||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
this.client.removeListener(Events.GUILD_APPLICATION_COMMANDS_UPDATE, handler);
|
this.client.removeListener(Events.GUILD_APPLICATION_COMMANDS_UPDATE, handler);
|
||||||
|
Loading…
Reference in New Issue
Block a user