feat: awaitModal

This commit is contained in:
March 7th
2022-10-09 19:37:04 +07:00
parent fecfa7d03b
commit a141adf385
17 changed files with 335 additions and 67 deletions

View File

@@ -12,4 +12,6 @@ module.exports = (client, { d: data }) => {
status: false,
metadata: data,
});
// Delete cache
client._interactionCache.delete(data.nonce);
};

View File

@@ -8,8 +8,21 @@ module.exports = (client, { d: data }) => {
* @param {InteractionResponseBody} data data
*/
client.emit(Events.INTERACTION_SUCCESS, data);
// Get channel data
const cache = client._interactionCache.get(data.nonce);
const channel = cache.guildId
? client.guilds.cache.get(cache.guildId)?.channels.cache.get(cache.channelId)
: client.channels.cache.get(cache.channelId);
// Set data
const interaction = {
...cache,
...data,
};
const data_ = channel.interactions._add(interaction);
client.emit('interactionResponse', {
status: true,
metadata: data,
metadata: data_,
});
// Delete cache
// client._interactionCache.delete(data.nonce);
};