aboutsummaryrefslogtreecommitdiff
path: root/src/discord.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2021-03-06 02:09:40 +0100
committerDaniel Schadt <kingdread@gmx.de>2021-03-06 02:09:40 +0100
commit7398f8b7e9e5df6fe791383406c834b44fddbe2b (patch)
treeebb2ec26f3de5e136b1c8bc9ad33f239e8a78074 /src/discord.rs
parent4b58c051ed700406f14728b54bb3e2a739536739 (diff)
downloadezau-7398f8b7e9e5df6fe791383406c834b44fddbe2b.tar.gz
ezau-7398f8b7e9e5df6fe791383406c834b44fddbe2b.tar.bz2
ezau-7398f8b7e9e5df6fe791383406c834b44fddbe2b.zip
initial support for matrix log posting
Similar to Discord posting, this now allows ezau to post a message to the given Matrix room for every log. The text handling is still pretty bad and should be reworked, but so should the Discord one. This is just the initial support, now that the actual posting works we can add some tests and proper text parsing, together with unifying some of the logic between Discord and Matrix. Note that this currently only works for unencrypted rooms!
Diffstat (limited to 'src/discord.rs')
-rw-r--r--src/discord.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/discord.rs b/src/discord.rs
index 976b2d6..4d59580 100644
--- a/src/discord.rs
+++ b/src/discord.rs
@@ -87,7 +87,9 @@ impl EventHandler for Handler {
}
}
-pub fn post_link(discord_token: &str, channel_id: u64, log: Log, link: String) -> Result<()> {
+pub fn post_link(discord_token: &str, channel_id: u64, log: &Log, link: &str) -> Result<()> {
+ let link = link.to_owned();
+ let log = log.clone();
let mut rt = Runtime::new()?;
rt.block_on(async {