Skip to content

Commit

Permalink
useWSS false
Browse files Browse the repository at this point in the history
  • Loading branch information
banghasan committed Sep 20, 2021
1 parent cc69fc8 commit aac7ac5
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 66 deletions.
4 changes: 4 additions & 0 deletions core/duaevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class DuaEvent extends EventEmitter {
this.cmdPrefix = options.cmdPrefix;
}

options.useWSS = options.useWSS || false;

options.session = options.session || '';
options.session_name = options.session_name || false;
options.logDetail = options.logDetail || 'debug';
Expand All @@ -84,6 +86,8 @@ class DuaEvent extends EventEmitter {

options.connectionRetries = options.connectionRetries || 3;
options.markRead = options.hasOwnProperty('markRead') ? options.markRead : true;

options.more = options.more || {};
this.options = options;

} catch (error) {
Expand Down
6 changes: 4 additions & 2 deletions core/duagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DuaGram extends DuaCommand {
let {
as_bot_api, bot_token,
logDetail, logLevel, markRead,
floodSleepThreshold, connectionRetries
floodSleepThreshold, connectionRetries, useWSS, more
} = this.options;

Logger.setLevel(logDetail);
Expand All @@ -50,7 +50,9 @@ class DuaGram extends DuaCommand {
this.options.api_id,
this.options.api_hash,
{
connectionRetries
connectionRetries,
useWSS,
...more
}
);
this.client = client;
Expand Down
Loading

0 comments on commit aac7ac5

Please sign in to comment.