mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-21 19:47:21 -06:00
feat: webhook base64 option
This commit is contained in:
parent
547943a05c
commit
e26ae30f6f
@ -97,7 +97,6 @@ WEBHOOK:
|
|||||||
WEBHOOK_BY_EVENTS: false
|
WEBHOOK_BY_EVENTS: false
|
||||||
# Automatically maps webhook paths
|
# Automatically maps webhook paths
|
||||||
# Set the events you want to hear
|
# Set the events you want to hear
|
||||||
WEBHOOK_BASE64: false
|
|
||||||
EVENTS:
|
EVENTS:
|
||||||
APPLICATION_STARTUP: false
|
APPLICATION_STARTUP: false
|
||||||
QRCODE_UPDATED: true
|
QRCODE_UPDATED: true
|
||||||
|
@ -279,7 +279,6 @@ export class WAStartupService {
|
|||||||
this.localWebhook.webhook_base64 = data?.webhook_base64;
|
this.localWebhook.webhook_base64 = data?.webhook_base64;
|
||||||
this.logger.verbose(`Webhook by webhook_base64: ${this.localWebhook.webhook_base64}`);
|
this.logger.verbose(`Webhook by webhook_base64: ${this.localWebhook.webhook_base64}`);
|
||||||
|
|
||||||
|
|
||||||
this.logger.verbose('Webhook loaded');
|
this.logger.verbose('Webhook loaded');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1533,8 +1532,11 @@ export class WAStartupService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let messageRaw: MessageRaw;
|
let messageRaw: MessageRaw;
|
||||||
const globalWebhook = this.configService.get<Webhook>('WEBHOOK').GLOBAL;
|
|
||||||
if (this.localWebhook.webhook_base64 === true && received?.message.documentMessage || received?.message.imageMessage ) {
|
if (
|
||||||
|
(this.localWebhook.webhook_base64 === true && received?.message.documentMessage) ||
|
||||||
|
received?.message.imageMessage
|
||||||
|
) {
|
||||||
const buffer = await downloadMediaMessage(
|
const buffer = await downloadMediaMessage(
|
||||||
{ key: received.key, message: received?.message },
|
{ key: received.key, message: received?.message },
|
||||||
'buffer',
|
'buffer',
|
||||||
|
Loading…
Reference in New Issue
Block a user