https://github.com/topce/cirilica-deno
https://github.com/topce/cirilica-deno
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/topce/cirilica-deno
- Owner: topce
- Created: 2024-02-11T19:50:28.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-11T22:13:19.000Z (over 1 year ago)
- Last Synced: 2024-04-16T01:38:15.678Z (about 1 year ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust Deno DenoDeploy Telegram bot that translate text from Serbian Latin to Serbian Cyrillic
This project is generated with wasm build
It call rust library
from deno
after us it in telegram botthat is implemented with deno deploy
```
import { serve } from "";
import { Bot, webhookCallback } from "";const bot = new Bot(Deno.env.get("BOT_TOKEN") || "");
import { instantiate } from "";
const { translate } = await instantiate();
bot.command("start", (ctx) => ctx.reply(`
Veb aplikacija
https://topce.github.io/latinica2cirilica/
Unesi teks na latinici:`));
bot.command("about", (ctx) => ctx.reply(`
Veb aplikacija
https://topce.github.io/latinica2cirilica/
`));
bot.on("message", (ctx) => ctx.reply(translate(ctx.message?.text)));const handleUpdate = webhookCallback(bot, "std/http");
serve(async (req) => {
try {
const url = new URL(req.url);
if (url.searchParams.get("secret") !== Deno.env.get("FUNCTION_SECRET")) {
return new Response("not allowed", { status: 405 });
}return await handleUpdate(req);
} catch (err) {
console.error(err);
}
});
```# Причај Србски да те цио свијет разумије ;-)