mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-07 02:21:23 +00:00
redis publishing from last night
This commit is contained in:
1 parent
1be8f77b60
commit
575003107f
2 files changed
+4
-2
No files matched your search
@@ -32,6 +32,8 @@ async fn main() -> anyhow::Result<()> {
|
||||
let secrets = Secrets::from_file("secrets.toml")?;
|
||||
|
||||
let mut redis_client = RedisClient::new(&secrets.redis);
|
||||
redis_client.connect().await?;
|
||||
|
||||
let mut twitch_client = TwitchClient::new(&secrets.twitch, redis_client);
|
||||
|
||||
loop {
|
||||
|
||||
@@ -93,8 +93,8 @@ impl TwitchClient {
|
||||
let channel = command.to_lowercase();
|
||||
let username = msg.name().trim();
|
||||
let command_payload= format!("{}|{}", username, remaining_message); // Payload: USERNAME|DATA
|
||||
println!("Publish: {} - {}", channel, command_payload);
|
||||
let _r = self.redis_client.publish(&channel, &command_payload).await;
|
||||
println!("Publish: '{}' - '{}'", channel, command_payload);
|
||||
let _r = self.redis_client.publish(&channel, &command_payload).await.expect("Should work");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user