Skip to content

Commit

Permalink
Get item_id after voice upload (Androz2091#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizpvas authored Feb 9, 2021
1 parent 9303556 commit c4f6038
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/structures/Chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ class Chat {
*/
sendVoice (buffer) {
return new Promise((resolve) => {
this.threadEntity.broadcastVoice({ file: buffer }).then(({ item_id: itemID }) => {
this.threadEntity.broadcastVoice({ file: buffer }).then((upload) => {
let itemID = upload.message_metadata[0].item_id
if (this.typing && !this._disableTypingOnSend) this._keepTypingAlive()
this._sentMessagesPromises.set(itemID, resolve)
if (this.messages.has(itemID)) {
Expand Down

0 comments on commit c4f6038

Please sign in to comment.