A fully functional AI Powered Telegram bot.
🦀
Setup guide
- Install Rust with rustup.
- Create a Telegram bot with @BotFather and get the token
- Create an OpenAI API Platform account and get both API Token and Organization Id
- Add environment variables
- Put these lines into your Cargo.toml
[]
= "0.1.2"
= { = "0.12", = ["macros"] }
= "0.4"
= "0.4"
= { = "1.8", = ["rt-multi-thread", "macros"] }
Supported commands
You can do either:
👮🚨 ADMIN Commands
/mute X {h/m/s/p}
-> Mute an User from the Chat Group the selected time. 'p' is for 'permanent'/ban X {h/m/s/p}
-> Ban an User from the Chat Group the selected time. 'p' is for 'permanent'
🦀 AI Commands
/ask
for a specified question./mediate
to read the last N messages of a chat group and mitigate an argument.
Basic usage
TelitairoBot struct implements Default trait, so you can start a bot with a generic personality by just doing this:
let telitairo_bot = default;
Or partially initialize it like this:
let telitairo_bot = TelitairoBot
If you want to set your own parameters, you need to specify the personality of the bot as well as its criteria when mitigating an argument. A size for the context of the N last messages of the chat group is also needed.
For a detailed example go to TelitairoBot
Example
async