From 1fb049e4e6031f068c76ff6c121cf8d242dc8b09 Mon Sep 17 00:00:00 2001 From: Edgardo Date: Sun, 26 May 2019 20:37:23 -0500 Subject: [PATCH] Adding msgId support --- lib/wit.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/wit.js b/lib/wit.js index 73a6c10..9a82e3b 100644 --- a/lib/wit.js +++ b/lib/wit.js @@ -41,11 +41,14 @@ function Wit(opts) { this._sessions = {}; - this.message = (message, context, n, verbose, junk) => { + this.message = (message, context, n, verbose, junk, msgId) => { let qs = 'q=' + encodeURIComponent(message); if (context) { qs += '&context=' + encodeURIComponent(JSON.stringify(context)); } + if (msgId) { + qs += `&msg_id=${encodeURIComponent(msgId)}`; + } if (typeof n === 'number') { qs += '&n=' + encodeURIComponent(JSON.stringify(n)); }