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

SW-3014 #130

Merged
merged 7 commits into from
Mar 7, 2024
Merged
Changes from 1 commit
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
Next Next commit
add sendMessageExtended
  • Loading branch information
kocherovv committed Feb 21, 2024
commit 873a18c718d85e484d9d6d21e447540684ff9a8a
6 changes: 6 additions & 0 deletions src/utils/MessageAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ class MessageAPI {
* @param {String} message - text message
*/
async sendMessage(chatId, phoneNumber, message) {
return this.sendMessageExtended(chatId, phoneNumber, message, "", true)
}

async sendMessageExtended(chatId, phoneNumber, message, quotedMessageId, linkPreview) {
CommonUtils.validateChatIdPhoneNumber(chatId, phoneNumber);
CommonUtils.validateString('message', message);

const method = 'sendMessage';

const postData = {
'message': message,
'quotedMessageId': quotedMessageId,
'linkPreview': linkPreview
}

this.addChadIdParam(postData, chatId)
Expand Down