This is a library for integrating Discord in your flow function for flows.network.
```rust use discordflows::{listentochannel, createtextmessagein_channel};
pub fn run() { listentochannel("myserver", "mychannel", |sm| { createtextmessageinchannel("myserver", "mychannel", format!("Hello, {}", sm.contetn), Some(sm.id) ); }); } ```
In run()
the listen_to_channel
will create a listener for new message from channel mychannel
in guild myserver
.
When a new message is sent to mychannel
, the callback closure will be called with the TextMessage
then create_text_message_in_channel
.
The whole document is here.