File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,8 @@ import { WebHookService } from '../service/WebHook';
1414export class CopBot {
1515 private static instance : CopBot ;
1616 private _bot : Bot < Context > ;
17- private _webhookService : WebHookService ;
1817 private constructor ( ) {
1918 this . _bot = new Bot < Context > ( Config . token , { client : { timeoutSeconds : 20 } } ) ;
20- this . _webhookService = new WebHookService ( this . _bot ) ;
2119 }
2220 // Public method to get the singleton instance of CopBot
2321 public static getInstance ( ) : CopBot {
@@ -42,9 +40,9 @@ export class CopBot {
4240 console . log ( 'Setting webhook...' ) ;
4341 try {
4442 console . log ( 'Setting up webhook...' ) ;
45- await this . _webhookService . setupWebHook ( ) ;
46- await this . _webhookService . initial ( ) ;
47- this . _webhookService . startServer ( ) ;
43+ const _webhookService = new WebHookService ( this . _bot ) ;
44+ await _webhookService . setupWebHook ( ) ;
45+ _webhookService . startServer ( ) ;
4846 console . log ( `Bot started in webhook mode` ) ;
4947 } catch ( err ) {
5048 console . error ( 'Error setting up webhook:' , err ) ;
You can’t perform that action at this time.
0 commit comments