File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 2020 "clean" : " rm -rf dist" ,
2121 "main" : " npm run build & node --env-file=.env dist/app.js" ,
2222 "start" : " NODE_ENV=development node --trace-uncaught -r ts-node/register --env-file=.env src/app.ts" ,
23- "start:deploy" : " NODE_ENV=production node --trace-uncaught -r ts-node/register src/app.ts" ,
24- "start:deplow:dev" : " NODE_ENV=development node --trace-uncaught -r ts-node/register src/app.ts"
23+ "start:deploy" : " NODE_ENV=production node --trace-uncaught -r ts-node/register src/app.ts"
2524 },
2625 "repository" : {
2726 "type" : " git" ,
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ export class CopBot {
3232 const isProduction = Config . environment === 'production' ;
3333 if ( isProduction ) {
3434 const server = http . createServer ( async ( req , res ) => {
35+ console . log ( 'method' , req . method ) ;
36+ console . log ( 'url' , req . url ) ;
37+
3538 if ( req . method === 'POST' && req . url === '/webhook' ) {
3639 let body = '' ;
3740 req . on ( 'data' , ( chunk ) => {
@@ -71,6 +74,11 @@ export class CopBot {
7174 } ) ;
7275 await this . _bot . api . setWebhook ( `${ web_hook } ` ) ;
7376 console . log ( `Webhook set successfully to: ${ web_hook } ` ) ;
77+ await this . _bot . start ( {
78+ onStart : ( botInfo ) => {
79+ console . log ( `Bot started in Webhook mode! Username: ${ botInfo . username } ` ) ;
80+ } ,
81+ } ) ;
7482 } else {
7583 try {
7684 await this . _bot . start ( {
You can’t perform that action at this time.
0 commit comments