An open API service indexing awesome lists of open source software.

https://github.com/topce/cirilica-deno


https://github.com/topce/cirilica-deno

Last synced: 3 months ago
JSON representation

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);
}
});
```

# Причај Србски да те цио свијет разумије ;-)