Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Latest commit

History

47 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Telegram Bot

Provides an API and a process to build telegram bots on kinode.

Example Usage

First, you need to obtain a bot token from BotFather on telegram. Once you have that, you can clone this repo, run kit b on it to build it, (instructions for installing kit here), and put it's wasm in your package folder as tg.wasm.

Then put tg/src/tg_api.rs somewhere in your app, and make it callable by putting mod tg_api in your code.

You might have to add some dependencies used by the bot to your Cargo.toml:

frankenstein = { version = "0.30",default-features = false, features = ["telegram-trait"]}
url = "2.5.0"

Then, spawning a worker that forwards you updates:

let(api, tg_worker) = tg_api::init_tg_bot(our.clone,"your_token",None)?;// the third argument is an optional getUpdatesParams, here you can specify if you want specific updates only!

Updates will come in from tg_worker processId with the enum:

pubenumTgResponse{Update(TgUpdate),Error(String),}pubstructTgUpdate{pubupdates:Vec<Update>,}

And calling a method like get_chat_member_count:

use frankenstein::{GetChatMemberCountParams,ChatId}let params = frankenstein::GetChatMemberCountParams{chat_id:ChatId::Integer(123)}let member_count:u32 = api.get_chat_member_count(&params)?;

Repos

Some projects using this:

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages