Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MetaAI (@bot) send/receive messages capability #1252

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Socket/messages-recv.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

import { Boom } from '@hapi/boom'

Check failure on line 2 in src/Socket/messages-recv.ts

View workflow job for this annotation

GitHub Actions / check-lint

Run autofix to sort these imports!
import { randomBytes } from 'crypto'
import NodeCache from 'node-cache'
import { proto } from '../../WAProto'
import { DEFAULT_CACHE_TTLS, KEY_BUNDLE_TYPE, MIN_PREKEY_COUNT } from '../Defaults'
import { MessageReceiptType, MessageRelayOptions, MessageUserReceipt, SocketConfig, WACallEvent, WAMessageKey, WAMessageStatus, WAMessageStubType, WAPatchName } from '../Types'
import { getBotJid } from '../WABinary'
import {
aesDecryptCTR,
aesEncryptGCM,
Expand Down Expand Up @@ -198,7 +199,8 @@
}

if(node.attrs.recipient) {
receipt.attrs.recipient = node.attrs.recipient
//Fixes problem with retry that is never done when it is @bot
receipt.attrs.recipient = getBotJid(node.attrs.recipient);

Check failure on line 203 in src/Socket/messages-recv.ts

View workflow job for this annotation

GitHub Actions / check-lint

Extra semicolon
}

if(node.attrs.participant) {
Expand Down Expand Up @@ -753,13 +755,13 @@
}
}


const { fullMessage: msg, category, author, decrypt } = decryptMessageNode(
node,
authState.creds.me!.id,
authState.creds.me!.lid || '',
signalRepository,
logger,
getMessage
)

if(response && msg?.messageStubParameters?.[0] === NO_MESSAGE_FOUND_ERROR_TEXT) {
Expand Down
Loading