https://github.com/topce/cirilica-deno
https://github.com/topce/cirilica-deno
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/topce/cirilica-deno
- Owner: topce
- Created: 2024-02-11T19:50:28.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-11T22:13:19.000Z (over 2 years ago)
- Last Synced: 2025-04-25T14:58:17.312Z (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 bot
that 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);
}
});
```
# Причај Србски да те цио свијет разумије ;-)