2022-03-19 17:37:45 +07:00
|
|
|
'use strict';
|
2022-04-12 20:46:25 +07:00
|
|
|
const { Events } = require('../../../util/Constants');
|
2022-03-19 17:37:45 +07:00
|
|
|
|
2022-06-13 23:53:43 +07:00
|
|
|
/**
|
|
|
|
* @typedef {Object} InteractionResponseBody
|
2022-09-29 19:45:22 +07:00
|
|
|
* @property {Snowflake} id Interaction ID
|
2022-06-13 23:53:43 +07:00
|
|
|
* @property {Snowflake} nonce nonce in POST /interactions
|
|
|
|
*/
|
|
|
|
|
2022-03-19 17:37:45 +07:00
|
|
|
module.exports = (client, packet) => {
|
2022-07-12 19:30:18 +07:00
|
|
|
if (client.user.bot) {
|
|
|
|
client.actions.InteractionCreate.handle(packet.d);
|
|
|
|
} else {
|
|
|
|
client.emit(Events.INTERACTION_CREATE, packet.d);
|
|
|
|
}
|
2022-03-19 17:37:45 +07:00
|
|
|
};
|