diff --git a/site/docs/es/hosting/deno-deploy.md b/site/docs/es/hosting/deno-deploy.md index 65be99234..3463753c8 100644 --- a/site/docs/es/hosting/deno-deploy.md +++ b/site/docs/es/hosting/deno-deploy.md @@ -23,14 +23,13 @@ El resultado de este tutorial [puede verse en nuestro repositorio de bots de eje 2. Crea un archivo llamado `mod.ts` o `mod.js`, o en realidad cualquier nombre que te guste (pero deberías recordar y usar este como el archivo principal para desplegar), con el siguiente contenido: ```ts -import { serve } from "https://deno.land/std/http/server.ts"; import { Bot, webhookCallback } from "https://deno.land/x/grammy/mod.ts"; // Puedes modificar esto a la forma correcta de importar tu objeto `Bot`. import bot from "./bot.ts"; const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { if (req.method === "POST") { const url = new URL(req.url); if (url.pathname.slice(1) === bot.token) { diff --git a/site/docs/es/hosting/fly.md b/site/docs/es/hosting/fly.md index 7f6d682b3..31a22fb4c 100644 --- a/site/docs/es/hosting/fly.md +++ b/site/docs/es/hosting/fly.md @@ -21,7 +21,6 @@ Puedes ejecutar tu bot usando ambos [webhooks o long polling](../guide/deploymen ::: code-group ```ts{11} [Deno] -import { serve } from "https://deno.land/std/http/server.ts"; import { webhookCallback } from "https://deno.land/x/grammy/mod.ts"; // Podrías modificar esto a la forma correcta de importar tu objeto `Bot`. import { bot } from "./bot.ts"; @@ -29,7 +28,7 @@ import { bot } from "./bot.ts"; const port = 8000; const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { const url = new URL(req.url); if (req.method === "POST" && url.pathname.slice(1) === bot.token) { try { diff --git a/site/docs/es/hosting/supabase.md b/site/docs/es/hosting/supabase.md index 43bc741a8..4db3a8ec5 100644 --- a/site/docs/es/hosting/supabase.md +++ b/site/docs/es/hosting/supabase.md @@ -36,7 +36,6 @@ Una vez que hayas creado un proyecto de Supabase Function, puedes escribir tu bo Puedes utilizar este breve ejemplo de bot como punto de partida. ```ts -import { serve } from "https://deno.land/std/http/server.ts"; import { Bot, webhookCallback } from "https://deno.land/x/grammy/mod.ts"; const token = Deno.env.get("BOT_TOKEN"); @@ -49,7 +48,7 @@ bot.command("ping", (ctx) => ctx.reply(`¡Pong! ${new Date()}`)); const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { try { const url = new URL(req.url); if (url.searchParams.get("secret") !== bot.token) { diff --git a/site/docs/hosting/deno-deploy.md b/site/docs/hosting/deno-deploy.md index 37d054fff..0926763af 100644 --- a/site/docs/hosting/deno-deploy.md +++ b/site/docs/hosting/deno-deploy.md @@ -23,14 +23,13 @@ The result of this tutorial [can be seen in our example bots repository](https:/ 2. Create a file named `mod.ts` or `mod.js`, or actually any name you like (but you should be remembering and using this as the main file to deploy), with the following content: ```ts -import { serve } from "https://deno.land/std/http/server.ts"; import { webhookCallback } from "https://deno.land/x/grammy/mod.ts"; // You might modify this to the correct way to import your `Bot` object. import bot from "./bot.ts"; const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { if (req.method === "POST") { const url = new URL(req.url); if (url.pathname.slice(1) === bot.token) { diff --git a/site/docs/hosting/fly.md b/site/docs/hosting/fly.md index 5cc95f63d..9ffdcb8b6 100644 --- a/site/docs/hosting/fly.md +++ b/site/docs/hosting/fly.md @@ -21,7 +21,6 @@ You can run your bot using both [webhooks or long polling](../guide/deployment-t ::: code-group ```ts{11} [Deno] -import { serve } from "https://deno.land/std/http/server.ts"; import { webhookCallback } from "https://deno.land/x/grammy/mod.ts"; // You might modify this to the correct way to import your `Bot` object. import { bot } from "./bot.ts"; @@ -29,7 +28,7 @@ import { bot } from "./bot.ts"; const port = 8000; const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { const url = new URL(req.url); if (req.method === "POST" && url.pathname.slice(1) === bot.token) { try { diff --git a/site/docs/hosting/supabase.md b/site/docs/hosting/supabase.md index c835221a9..c438167a0 100644 --- a/site/docs/hosting/supabase.md +++ b/site/docs/hosting/supabase.md @@ -36,7 +36,6 @@ Once you have created a Supabase Function project, you can write your bot. You can use this short example bot as a starting point. ```ts -import { serve } from "https://deno.land/std/http/server.ts"; import { Bot, webhookCallback } from "https://deno.land/x/grammy/mod.ts"; const token = Deno.env.get("BOT_TOKEN"); @@ -49,7 +48,7 @@ bot.command("ping", (ctx) => ctx.reply(`Pong! ${new Date()}`)); const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { try { const url = new URL(req.url); if (url.searchParams.get("secret") !== bot.token) { diff --git a/site/docs/id/hosting/deno-deploy.md b/site/docs/id/hosting/deno-deploy.md index 5fb343b93..84d84f55c 100644 --- a/site/docs/id/hosting/deno-deploy.md +++ b/site/docs/id/hosting/deno-deploy.md @@ -25,14 +25,13 @@ Hasil dari tutorial disini dapat dilihat di [repositori bot kami](https://github 2. Buat sebuah file dengan nama `mod.ts` atau `mod.js`, ataupun nama lainnya sesuai dengan keinginanmu (tetapi kamu harus mengingatnya karena nanti file tersebut akan digunakan sebagai file deploy utama). File tersebut berisikan: ```ts -import { serve } from "https://deno.land/std/http/server.ts"; import { webhookCallback } from "https://deno.land/x/grammy/mod.ts"; // Kamu mungkin perlu mengubah ini agar dapat melakukan import pada object bot-mu. import bot from "./bot.ts"; const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { if (req.method === "POST") { const url = new URL(req.url); if (url.pathname.slice(1) === bot.token) { diff --git a/site/docs/id/hosting/fly.md b/site/docs/id/hosting/fly.md index 8242b75cd..23911eb46 100644 --- a/site/docs/id/hosting/fly.md +++ b/site/docs/id/hosting/fly.md @@ -21,7 +21,6 @@ Kamu bisa menjalankan bot menggunakan [webhooks ataupun long polling](../guide/d ::: code-group ```ts{11} [Deno] -import { serve } from "https://deno.land/std/http/server.ts"; import { webhookCallback } from "https://deno.land/x/grammy/mod.ts"; // Kamu mungkin perlu mengubah ini agar object bot-mu bisa di-import. import { bot } from "./bot.ts"; @@ -29,7 +28,7 @@ import { bot } from "./bot.ts"; const port = 8000; const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { const url = new URL(req.url); if (req.method === "POST" && url.pathname.slice(1) === bot.token) { try { diff --git a/site/docs/id/hosting/supabase.md b/site/docs/id/hosting/supabase.md index c53de4f40..34194c89b 100644 --- a/site/docs/id/hosting/supabase.md +++ b/site/docs/id/hosting/supabase.md @@ -37,7 +37,6 @@ Setelah berhasil membuat sebuah proyek Supabase Function, sekarang kamu bisa men Kamu bisa menggunakan contoh bot singkat ini sebagai entry point-nya. ```ts -import { serve } from "https://deno.land/std/http/server.ts"; import { Bot, webhookCallback } from "https://deno.land/x/grammy/mod.ts"; const token = Deno.env.get("BOT_TOKEN"); @@ -53,7 +52,7 @@ bot.command("ping", (ctx) => ctx.reply(`Pong! ${new Date()}`)); const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { try { const url = new URL(req.url); if (url.searchParams.get("secret") !== bot.token) { diff --git a/site/docs/uk/hosting/deno-deploy.md b/site/docs/uk/hosting/deno-deploy.md index 6e756d1d0..ad3c27484 100644 --- a/site/docs/uk/hosting/deno-deploy.md +++ b/site/docs/uk/hosting/deno-deploy.md @@ -23,14 +23,13 @@ Deno Deploy ідеально підходить для більшості про 2. Створіть файл з назвою `mod.ts` або `mod.js` або насправді будь-якою назвою, яку ви хочете, але ви повинні памʼятати та використовувати його як головний файл для розгортання, із наступним вмістом: ```ts -import { serve } from "https://deno.land/std/http/server.ts"; import { webhookCallback } from "https://deno.land/x/grammy/mod.ts"; // Ви можете змінити це на правильний спосіб імпорту вашого обʼєкта `Bot`. import bot from "./bot.ts"; const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { if (req.method === "POST") { const url = new URL(req.url); if (url.pathname.slice(1) === bot.token) { diff --git a/site/docs/uk/hosting/fly.md b/site/docs/uk/hosting/fly.md index 4c1de0af7..3ee814ebe 100644 --- a/site/docs/uk/hosting/fly.md +++ b/site/docs/uk/hosting/fly.md @@ -21,7 +21,6 @@ next: false ::: code-group ```ts{11} [Deno] -import { serve } from "https://deno.land/std/http/server.ts"; import { webhookCallback } from "https://deno.land/x/grammy/mod.ts"; // Ви можете змінити це на правильний спосіб імпорту вашого обʼєкта `Bot`. import { bot } from "./bot.ts"; @@ -29,7 +28,7 @@ import { bot } from "./bot.ts"; const port = 8000; const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { const url = new URL(req.url); if (req.method === "POST" && url.pathname.slice(1) === bot.token) { try { diff --git a/site/docs/uk/hosting/supabase.md b/site/docs/uk/hosting/supabase.md index c74fd7458..66fc8aefe 100644 --- a/site/docs/uk/hosting/supabase.md +++ b/site/docs/uk/hosting/supabase.md @@ -36,7 +36,6 @@ supabase functions new telegram-bot Для початку ви можете скористатися цим простим прикладом бота. ```ts -import { serve } from "https://deno.land/std/http/server.ts"; import { Bot, webhookCallback } from "https://deno.land/x/grammy/mod.ts"; const token = Deno.env.get("BOT_TOKEN"); @@ -49,7 +48,7 @@ bot.command("ping", (ctx) => ctx.reply(`Понг! ${new Date()}`)); const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { try { const url = new URL(req.url); if (url.searchParams.get("secret") !== bot.token) { diff --git a/site/docs/zh/hosting/deno-deploy.md b/site/docs/zh/hosting/deno-deploy.md index 5724e3fc7..6fc6548ba 100644 --- a/site/docs/zh/hosting/deno-deploy.md +++ b/site/docs/zh/hosting/deno-deploy.md @@ -23,14 +23,13 @@ Deno Deploy 是大多数简单 bot 的理想选择,并且你应该注意,Den 2. 创建一个名为 `mod.ts` 或 `mod.js` 的文件,或任何你喜欢的名字(但你应该记住并使用这个文件作为部署的主要文件),其内容如下: ```ts -import { serve } from "https://deno.land/std/http/server.ts"; import { webhookCallback } from "https://deno.land/x/grammy/mod.ts"; // 你可以将其修改为正确的方式来导入你的 `Bot` 对象。 import bot from "./bot.ts"; const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { if (req.method === "POST") { const url = new URL(req.url); if (url.pathname.slice(1) === bot.token) { diff --git a/site/docs/zh/hosting/fly.md b/site/docs/zh/hosting/fly.md index 4354d7894..dcbeee944 100644 --- a/site/docs/zh/hosting/fly.md +++ b/site/docs/zh/hosting/fly.md @@ -21,7 +21,6 @@ next: false ::: code-group ```ts{11} [Deno] -import { serve } from "https://deno.land/std/http/server.ts"; import { webhookCallback } from "https://deno.land/x/grammy/mod.ts"; // 你可以将其修改为导入 `Bot` 对象的正确方式 import { bot } from "./bot.ts"; @@ -29,7 +28,7 @@ import { bot } from "./bot.ts"; const port = 8000; const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { const url = new URL(req.url); if (req.method === "POST" && url.pathname.slice(1) === bot.token) { try { diff --git a/site/docs/zh/hosting/supabase.md b/site/docs/zh/hosting/supabase.md index 1c71c44af..39f031ffd 100644 --- a/site/docs/zh/hosting/supabase.md +++ b/site/docs/zh/hosting/supabase.md @@ -36,7 +36,6 @@ supabase functions new telegram-bot 你可以使用这个简单的示例 bot 作为一个起点。 ```ts -import { serve } from "https://deno.land/std/http/server.ts"; import { Bot, webhookCallback } from "https://deno.land/x/grammy/mod.ts"; const token = Deno.env.get("BOT_TOKEN"); @@ -49,7 +48,7 @@ bot.command("ping", (ctx) => ctx.reply(`Pong! ${new Date()}`)); const handleUpdate = webhookCallback(bot, "std/http"); -serve(async (req) => { +Deno.serve(async (req) => { try { const url = new URL(req.url); if (url.searchParams.get("secret") !== bot.token) {