mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
add send text message function
This commit is contained in:
parent
8dc58d60c4
commit
272ece07e8
2 changed files with 27 additions and 9 deletions
10
index.html
10
index.html
|
|
@ -291,15 +291,9 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// compose message
|
||||
const txtType = Constants.TxtTypes.Plain;
|
||||
const attempt = 0;
|
||||
const senderTimestamp = Math.floor(Date.now() / 1000);
|
||||
const pubKeyPrefix = contact.publicKey;
|
||||
const text = message;
|
||||
|
||||
// send message
|
||||
await this.connection.sendCommandSendTxtMsg(txtType, attempt, senderTimestamp, pubKeyPrefix, text);
|
||||
const response = await this.connection.sendTextMessage(contact.publicKey, message);
|
||||
console.log(response);
|
||||
|
||||
},
|
||||
async resetPath(contact) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue