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
//! # fluxer-rs
//!
//! Rust API wrapper for [Fluxer](https://fluxer.app). Handles the gateway
//! connection, heartbeating, reconnection, and event dispatch.
//!
//! # Quick Start
//!
//! ```rust,no_run
//! use fluxer::prelude::*;
//!
//! struct MyHandler;
//!
//! #[async_trait]
//! impl EventHandler for MyHandler {
//! async fn on_ready(&self, _ctx: Context, ready: Ready) {
//! println!("Logged in as {}", ready.user.username);
//! }
//!
//! async fn on_message(&self, ctx: Context, msg: Message) {
//! if msg.content.as_deref() == Some("!ping") {
//! let channel_id = msg.channel_id.as_deref().unwrap_or_default();
//! let _ = ctx.http.send_message(channel_id, "Pong!").await;
//! }
//! }
//! }
//!
//! #[tokio::main]
//! async fn main() {
//! let mut client = Client::builder("your-bot-token")
//! .event_handler(MyHandler)
//! .build();
//!
//! client.start().await.expect("Client error");
//! }
//! ```
/// Re-exports the stuff you'll need most of the time so you can just `use fluxer::prelude::*;` and get going.