Crates.io | telitairos-bot |
lib.rs | telitairos-bot |
version | 0.2.0 |
source | src |
created_at | 2024-06-12 11:27:41.891328 |
updated_at | 2024-06-14 10:16:24.913879 |
description | A fully funcional AI Powered assistant Telegram Bot |
homepage | |
repository | |
max_upload_size | |
id | 1269579 |
size | 89,813 |
- TELOXIDE_TOKEN= "/* Your Telegram Bot API Key */"
- OPENAI_API_KEY= "/* Your OpenAI API Key */"
- OPENAI_ORG_ID= "/* Your OpenAI Organization ID */"
[dependencies]
telitairos-bot = "0.1.2"
teloxide = { version = "0.12", features = ["macros"] }
log = "0.4"
pretty_env_logger = "0.4"
tokio = { version = "1.8", features = ["rt-multi-thread", "macros"] }
You can do either:
/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'/ask
for a specified question.
/mediate
to read the last N messages of a chat group and mitigate an argument.
TelitairoBot struct implements Default trait, so you can start a bot with a generic personality by just doing this:
let telitairo_bot = TelitairoBot::default();
Or partially initialize it like this:
let telitairo_bot = TelitairoBot {
personality: String::from("You are a Victorian era, tea addicted assistant"),
..Default::default(),
}
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
#[tokio::main]
async fn main() {
pretty_env_logger::init();
log::info!("Starting bot");
let telitairo_bot = TelitairoBot::new(
String::from(/*Personality */),
String::from(/* Mediation criteria */),
/*size */,
);
telitairo_bot.dispatch().await;
}