mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-23 03:01:03 +00:00
feat(bots/discord)!: allow message scan response to be message payloads
This commit is contained in:
@@ -27,7 +27,8 @@ withContext(on, 'messageCreate', async (context, msg) => {
|
||||
logger.debug('Response found')
|
||||
|
||||
const reply = await msg.reply({
|
||||
embeds: [createMessageScanResponseEmbed(response, label ? 'nlp' : 'match')],
|
||||
...response,
|
||||
embeds: response.embeds?.map(it => createMessageScanResponseEmbed(it, label ? 'nlp' : 'match')),
|
||||
})
|
||||
|
||||
if (label)
|
||||
@@ -64,7 +65,8 @@ withContext(on, 'messageCreate', async (context, msg) => {
|
||||
if (response) {
|
||||
logger.debug(`Response found for attachment: ${attachment.url}`)
|
||||
await msg.reply({
|
||||
embeds: [createMessageScanResponseEmbed(response, 'ocr')],
|
||||
...response,
|
||||
embeds: response.embeds?.map(it => createMessageScanResponseEmbed(it, 'ocr')),
|
||||
})
|
||||
|
||||
break
|
||||
|
||||
@@ -46,7 +46,12 @@ withContext(on, 'messageReactionAdd', async (context, rct, user) => {
|
||||
const member = await reactionMessage.guild.members.fetch(user.id)
|
||||
const { permissions, roles } = allowedMembers
|
||||
|
||||
if (!((permissions ? member.permissions.has(permissions) : false) || roles?.some(role => member.roles.cache.has(role))))
|
||||
if (
|
||||
!(
|
||||
(permissions ? member.permissions.has(permissions) : false) ||
|
||||
roles?.some(role => member.roles.cache.has(role))
|
||||
)
|
||||
)
|
||||
return
|
||||
} else if (allowedUsers) {
|
||||
if (!allowedUsers.includes(user.id)) return
|
||||
|
||||
Reference in New Issue
Block a user