1
0
Fork 0

Fix bridging interaction responses and edits

This commit is contained in:
Cadence Ember 2023-10-10 11:23:51 +13:00
parent e2dffe457e
commit 7790d98c66
5 changed files with 201 additions and 3 deletions

View file

@ -47,4 +47,14 @@ function getPermissions(userRoles, guildRoles, userID, channelOverwrites) {
return allowed
}
/**
* Command interaction responses have a webhook_id for some reason, but still have real author info of a real bot user in the server.
* @param {DiscordTypes.APIMessage} message
*/
function isWebhookMessage(message) {
const isInteractionResponse = message.type === 20
return message.webhook_id && !isInteractionResponse
}
module.exports.getPermissions = getPermissions
module.exports.isWebhookMessage = isWebhookMessage