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
55
56
57
58
59
60
61
// SPDX-License-Identifier: AGPL-3.0-or-later
// SPDX-FileCopyrightText: 2025 Wojtek Porczyk <woju@hackerspace.pl>
//! Prelude module for rdzobot.
//!
//! This module re-exports several items required for most common code. In particular, there's very
//! common pattern to handle a text message by replying to it:
//!
//! ```
//! # use rdzobot::prelude::*;
//! pub async fn on_room_message(
//! event: OriginalSyncRoomMessageEvent,
//! client: Client,
//! room: Room,
//! bot: Ctx<Rdzobot>,
//! ) -> anyhow::Result<()> {
//! let Some(body) = text_message_gate(&event, &client, &room) else {
//! return Ok(());
//! };
//!
//! // handle the message using `body`
//!
//! if body.starts_with("hello") {
//! room.send(
//! RoomMessageEventContent::notice_plain("Hello, world!")
//! .make_reply_to(&event.clone().into_full_event(room.room_id().into()),
//! ForwardThread::No,
//! AddMentions::Yes,
//! ));
//! }
//!
//! Ok(())
//! }
//! ```
//!
//! All necessary types are provided by this module.
pub use crateRdzobot;
pub use crate;
pub use ;
pub use Ctx;
pub use OwnedRoomOrAliasId;
pub use ;
pub use ;
pub use Deserialize;