Replies: 3 comments
-
Hi. Can you provide more code? For example, make a demo test project to fix the error. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi there, if you are facing same issue (especially with NestJs), please check any response interceptors that you are using. Here is a sample response interceptor and how I solve the problem: export class ResponseInterceptor implements NestInterceptor {
constructor(
private readonly logger = new Logger(),
) {
}
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown> {
return next.handle().pipe(
map((res: unknown) => this.responseHandler(res, context)),
catchError((err: HttpException) => throwError(() => this.errorHandler(err, context))),
);
}
errorHandler(exception: HttpException, context: ExecutionContext) {
if ((context.getType() as string) === 'telegraf') {
// handle telegraf exception
};
}
async responseHandler(res: any, context: ExecutionContext) {
if ((context.getType() as string) === 'telegraf') return res;
// process as normal
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
same with me |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Im using nestJs, and in this function:
@Start() async start(@Ctx() ctx: Context) { await ctx.reply( 'Welcome', ); }
I got the message Welcome in my telegram but with one more line message: [Object object]. How can i config to remove [Object object]?
Thank everyone
Beta Was this translation helpful? Give feedback.
All reactions