1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Chat platform adapters for Garudust agents.
//!
//! Each adapter implements [`garudust_core::platform::PlatformAdapter`] and
//! connects the agent to an external messaging platform. Enable only the
//! platforms you need via Cargo features.
//!
//! # Feature flags
//!
//! | Feature | Platform | Adapter |
//! |---|---|---|
//! | `telegram` *(default)* | Telegram Bot API | [`telegram::TelegramAdapter`] |
//! | `webhook` *(default)* | HTTP Webhook | [`webhook::WebhookAdapter`] |
//! | `discord` | Discord Gateway | [`discord::DiscordAdapter`] |
//! | `slack` | Slack RTM/Events | [`slack::SlackAdapter`] |
//! | `matrix` | Matrix (Element) | [`matrix::MatrixAdapter`] |
//! | `line` | LINE Messaging API | [`line::LineAdapter`] |
//! | `all` | All of the above | — |
//!
//! # Example — running Telegram and a webhook simultaneously
//!
//! ```no_run
//! use std::sync::Arc;
//! use garudust_platforms::{telegram::TelegramAdapter, webhook::WebhookAdapter};
//! use garudust_core::platform::{MessageHandler, PlatformAdapter};
//!
//! async fn start(handler: Arc<dyn MessageHandler>) -> anyhow::Result<()> {
//! let tg = TelegramAdapter::new(std::env::var("TELEGRAM_TOKEN")?);
//! let wh = WebhookAdapter::new(3001);
//! tg.start(handler.clone()).await?;
//! wh.start(handler).await?;
//! Ok(())
//! }
//! ```