- TypeScript 97.6%
- Shell 2.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
config.ts imported https://deno.land/x/dotenv/mod.ts - a URL with no version in it, so every run took whatever that path happened to serve, which is both a supply-chain hole and unreproducible. It also called config() once per export, reading the .env file twice. `deno run --env-file` loads it with no third-party dependency at all, and both TOKEN and ADMIN are now required up front, naming whichever is missing instead of handing an empty token to grammy. grammy moved into the `imports` map of a new deno.json, which is what Deno's own no-import-prefix lint rule asks for, and deno.lock pins the whole tree. While it was there it went from v1.10.1 to v1.38.4; the type check is clean on both. `deno check` reported nine errors before and reports none now: - ctx.message, ctx.inlineQuery and ctx.chosenInlineResult were all read off a bare Context, where each is optional. The handlers take grammy's narrowed CommandContext and Filter<Context, ...> types instead, which is what the registrations actually pass them. - `let name: string = ctx.message.from?.first_name` assigned an optional to a string and then appended to it, so a user with no first name was greeted as "Привет, undefined!". The name is assembled from the parts that exist. - intros was an array of mixed arrays, inferred as (string | number)[][], which made every inline result title a string | number. It is typed as a tuple now, which also removes the .toString() on the description. - `type: "article"` and `parse_mode: "HTML"` widened to string and failed to match InlineQueryResult. One real bug on the way through: the empty-query branch of inlineQueryFunc had no return, so it answered the query and then fell through and answered it again, which Telegram rejects. It also did not await the first answer. The commented-out `return` on the next line suggests this was known. Added deno.json tasks (start, check, lint, fmt), a .gitattributes so the sources stay LF and `deno fmt` passes on a Windows checkout, and a CI workflow running all three. run.sh gained a shebang, `set -euo pipefail` and the --allow-env/--env-file flags it needed. README says how to run it. Note the Balaboba API this bot talks to was shut down by Yandex, as the README has said since 2024, so none of this makes the bot answer again - it makes the code build, pin and check cleanly. |
||
| .forgejo/workflows | ||
| images | ||
| .gitattributes | ||
| .gitignore | ||
| .sample.env | ||
| config.ts | ||
| deno.json | ||
| deno.lock | ||
| handlers.ts | ||
| index.ts | ||
| README.md | ||
| run.sh | ||
Warning
Balaboba's enjoying a well-deserved rest now. It was created in 2021 to demonstrate the features of the first version of YaLM (Yet another Language Model), but now is closed by its owner, Yandex.
YBalaBot
🫰🏻I will continue your text on any topic, preserving coherence and the desired style.
Report Bug
.
Request Feature
About The Project
This bot implements Yandex Balabola API engine for easy-to-use Telegram inline mode.
Balaboba demonstrates how neural networks of the YaLM family can generate a coherent text on any topic, while maintaining a preset style. In Balaboba’s case, YaLM is used for entertainment, but the models were originally developed for serious tasks – for example, to improve a search engine and develop a voice assistant. Learn more here.
Running it
cp .sample.env .env # TOKEN from @BotFather, ADMIN = your Telegram id
deno task start
deno task check, deno task lint and deno task fmt are what CI runs.
Dependencies live in the imports map of deno.json and are pinned by
deno.lock; --env-file loads .env, so there is no dotenv dependency.
Both TOKEN and ADMIN are required and the bot says which one is missing.
Built With
Thanks to:
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
- Please make sure you check your spelling and grammar.
- Create individual PR for each suggestion.
Creating A Pull Request
- Fork the Project
- Create your Feature Branch (
git checkout -b sadykhzadeh/YBalaBot) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin sadykhzadeh/YBalaBot) - Open a Pull Request
