aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDhravya Shah <[email protected]>2024-08-22 15:58:43 -0700
committerGitHub <[email protected]>2024-08-22 15:58:43 -0700
commit6a201de58d2e3b36afdf23f2be4951b26363b213 (patch)
treecc69b4d9d0b805db1cdd4bb15e78519bd652b4c1 /apps
parentundo changes (diff)
parentchore: Update Telegram bot with Markdown Support (diff)
downloadsupermemory-6a201de58d2e3b36afdf23f2be4951b26363b213.tar.xz
supermemory-6a201de58d2e3b36afdf23f2be4951b26363b213.zip
Merge pull request #240 from supermemoryai/telegram-markdown-mode
chore: Update Telegram bot with Markdown Support
Diffstat (limited to 'apps')
-rw-r--r--apps/web/app/api/telegram/route.ts19
1 files changed, 16 insertions, 3 deletions
diff --git a/apps/web/app/api/telegram/route.ts b/apps/web/app/api/telegram/route.ts
index c629e409..20241611 100644
--- a/apps/web/app/api/telegram/route.ts
+++ b/apps/web/app/api/telegram/route.ts
@@ -21,7 +21,10 @@ bot.command("start", async (ctx) => {
const cipherd = cipher(user.id.toString());
await ctx.reply(
- `Welcome to Supermemory bot. I am here to help you remember things better. Click here to create and link your account: https://supermemory.ai/signin?telegramUser=${cipherd}`,
+ `Welcome to Supermemory bot. I am here to help you remember things better. [Click here to create and link your account](https://supermemory.ai/signin?telegramUser=${cipherd})`,
+ {
+ parse_mode: "MarkdownV2",
+ },
);
});
@@ -38,7 +41,10 @@ bot.on("message", async (ctx) => {
if (!dbUser) {
await ctx.reply(
- `Welcome to Supermemory bot. I am here to help you remember things better. Click here to create and link your account: https://supermemory.ai/signin?telegramUser=${cipherd}`,
+ `Welcome to Supermemory bot. I am here to help you remember things better. [Click here to create and link your account](https://supermemory.ai/signin?telegramUser=${cipherd})`,
+ {
+ parse_mode: "MarkdownV2",
+ },
);
return;
@@ -103,7 +109,14 @@ bot.on("message", async (ctx) => {
.returning({ id: storedContent.id });
}
- await ctx.api.editMessageText(ctx.chat.id, message.message_id, data.response);
+ await ctx.api.editMessageText(
+ ctx.chat.id,
+ message.message_id,
+ data.response,
+ {
+ parse_mode: "MarkdownV2",
+ },
+ );
});
export const POST = webhookCallback(bot, "std/http");