Skip to content

Commit

Permalink
Nullify replyToMessageId is an empty str (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrashed-dev authored Nov 28, 2023
1 parent 6886643 commit 9747bfa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/models/draft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ export default class Draft extends Message implements DraftProperties {
if (this.rawMime) {
throw Error('saveRequestBody() cannot be called for raw MIME drafts');
}
return super.saveRequestBody();
const json = super.saveRequestBody();
if (this.replyToMessageId !== undefined && this.replyToMessageId === '') {
delete json.reply_to_message_id;
}
return json;
}

deleteRequestBody(
Expand Down

0 comments on commit 9747bfa

Please sign in to comment.