We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 555aa22 commit 33e1198Copy full SHA for 33e1198
apps/bot/src/handlers/question.handler.ts
@@ -4,6 +4,10 @@ import { UpdateEvent } from '@app/common';
4
5
const HIVEMIND_BLOCKLIST = ['-1002141367711']; // TODO: Move this to config
6
7
+function escapeMarkdownV2(text) {
8
+ return text.replace(/[_*[\]()~`>#+=|{}.!-]/g, '\\$&');
9
+}
10
+
11
export class QuestionHandler extends BaseHandler {
12
async handle(ctx: Context, event?: FilterQuery): Promise<void> {
13
try {
@@ -44,7 +48,7 @@ export class QuestionHandler extends BaseHandler {
44
48
};
45
49
46
50
this.logger.log('Reply from hivemind:', result);
47
- await ctx.reply(result, other);
51
+ await ctx.reply(escapeMarkdownV2(result), other);
52
}
53
} catch (error) {
54
this.logger.error(error);
0 commit comments