mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-01-09 05:12:28 -06:00
Feat Reject Message If is not a valid wpp number
This commit is contained in:
@@ -1684,6 +1684,27 @@ export class ChatwootService {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (event === 'contact.is_not_in_wpp') {
|
||||
const getConversation = await this.createConversation(instance, body);
|
||||
|
||||
if (!getConversation) {
|
||||
this.logger.warn('conversation not found');
|
||||
return;
|
||||
}
|
||||
|
||||
client.messages.create({
|
||||
accountId: this.provider.account_id,
|
||||
conversationId: getConversation,
|
||||
data: {
|
||||
content: `🚨 ${i18next.t('numbernotinwhatsapp')}`,
|
||||
message_type: 'incoming',
|
||||
private: true,
|
||||
},
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (event === 'messages.upsert' || event === 'send.message') {
|
||||
this.logger.verbose('event messages.upsert');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user