Skip to content

Commit

Permalink
update logging middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
devadathanmb committed Jan 22, 2024
1 parent 1f782cc commit dd0f165
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/middlewares/loggingMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ const loggingMiddleware: Middleware<CustomContext> = async (ctx, next) => {
console.log(
`➡️ [${time}] ${ctx.updateType} from ${
ctx.from?.first_name ? ctx.from.first_name : ""
} ${ctx.from?.last_name ? ctx.from.last_name : ""} ID : ${ctx.from?.id}`
} ${ctx.from?.last_name ? ctx.from.last_name : ""} ID : ${ctx.from?.id}`
);
if (ctx.updateType === "message") console.log(ctx.message);
else if (ctx.updateType === "callback_query") console.log(ctx.callbackQuery);
console.log(ctx.message);
/* if (ctx.updateType === "message") console.log(ctx.message); */
/* else if (ctx.updateType === "callback_query") console.log(ctx.callbackQuery); */
return next();
};

Expand Down

0 comments on commit dd0f165

Please sign in to comment.