Skip to content
This repository was archived by the owner on Aug 25, 2023. It is now read-only.

Commit 6111879

Browse files
Nicoals FAVREALCC01
authored andcommitted
Add debug option (#4)
1 parent 2df2378 commit 6111879

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Bot.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function Bot(token, options) {
2727
this.saveUsers = true;
2828
this.saveChats = true;
2929
this.enableHelp = true;
30+
this.debug = true;
3031
this.forms = {}; // user_id: {form, answers}
3132
this.webhookRoute = '/';
3233
this.webhookPort = 8080;
@@ -86,7 +87,9 @@ function Bot(token, options) {
8687
};
8788

8889
this.handleUpdates = (updates) => {
89-
console.log(JSON.stringify(updates));
90+
if (this.debug){
91+
console.log(JSON.stringify(updates));
92+
}
9093
if (updates.length > 0) {
9194
this.lastUpdate = updates[updates.length - 1].update_id + 1;
9295
var now = Date.now() / 1000;

0 commit comments

Comments
 (0)