Expand description
§A fully functional AI Powered Telegram bot
§Supported commands
You can either:
/ask
for a specified question./mediate
to read the last N messages of a chat group and mitigate an argument.
§Environment variables needed
- TELOXIDE_TOKEN= "/* Your Telegram Bot API Key */"
- OPENAI_API_KEY= "/* Your OpenAI API Key */"
- OPENAI_ORG_ID= "/* Your OpenAI Organization ID */"
§Basic usage
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
TelitairoBot struct implements Default trait, so you can start a bot with a generic personality by just doing this:
let telitairo_bot: TelitairoBot = Default::default();
But if you want to set your own Bot’s personality you can use the new()
function like this:
/* #[tokio::main] */
/*async*/ fn main() {
let telitairo_bot = TelitairoBot::new(
String::from("personality"),
String::from("mediation criteria"),
200 /* buffer size */,
);
/* telitairo_bot.dispatch().await; */
Structs§
- Telitairo
Bot - Defines the bot behavior