Skip to content

Commit

Permalink
docs: Updated docs for sendText and sendFile
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias authored Jun 8, 2022
1 parent 10c42f3 commit 1b884bf
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion src/api/layers/sender.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,18 @@ export class SenderLayer extends ListenerLayer {
* client.sendText('<number>@c.us', 'A simple message');
*
* // With buttons
* client.sendText('<number>@c.us', 'A simple message with buttons', {
* client.sendText('<number>@c.us', 'WPPConnect message with buttons', {
* useTemplateButtons: true, // False for legacy
* buttons: [
* {
* url: 'https://wppconnect-team.github.io/',
* text: 'WPPConnect Site'
* },
* {
* phoneNumber: '+55 11 22334455',
* text: 'Call me'
* },
* {
* id: 'your custom id 1',
* text: 'Some text'
* },
Expand Down Expand Up @@ -522,6 +530,38 @@ export class SenderLayer extends ListenerLayer {

/**
* Sends file from path or base64
*
* @example
* ```javascript
* // Simple message
* client.sendFile('<number>@c.us', 'data:text/plain;base64,V1BQQ29ubmVjdA==');
*
* // With buttons
* client.sendFile('<number>@c.us', 'data:text/plain;base64,V1BQQ29ubmVjdA==', {
* useTemplateButtons: true, // False for legacy
* buttons: [
* {
* url: 'https://wppconnect-team.github.io/',
* text: 'WPPConnect Site'
* },
* {
* phoneNumber: '+55 11 22334455',
* text: 'Call me'
* },
* {
* id: 'your custom id 1',
* text: 'Some text'
* },
* {
* id: 'another id 2',
* text: 'Another text'
* }
* ],
* title: 'Title text' // Optional
* footer: 'Footer text' // Optional
* });
* ```
*
* @category Chat
* @param to Chat id
* @param pathOrBase64 File path
Expand Down

0 comments on commit 1b884bf

Please sign in to comment.