Skip to content

Commit

Permalink
Use string for config friendliness
Browse files Browse the repository at this point in the history
  • Loading branch information
dcadenas committed Jul 25, 2024
1 parent 4a12292 commit a727c4a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/adapters/slack_client_adapter.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
use crate::actors::messages::SupervisorMessage;
use crate::actors::{SlackClientPort, SlackClientPortBuilder};
use crate::config::Configurable;
use crate::adapters::njump_or_pubkey;
use crate::config::Configurable;
use crate::domain_objects::ReportRequest;
use anyhow::Result;
use hyper_rustls::HttpsConnector;
use hyper_util::client::legacy::connect::HttpConnector;
use nostr_sdk::nips::nip56::Report;
use ractor::ActorRef;
use slack_morphism::prelude::*;
use serde::Deserialize;
use slack_morphism::prelude::*;
use tracing::info;

#[derive(Debug, Clone, Deserialize)]
pub struct Config {
pub token: SlackApiToken,
pub token: String,
pub channel_id: SlackChannelId,
}

Expand Down Expand Up @@ -51,7 +51,8 @@ impl SlackClientPortBuilder for SlackClientAdapterBuilder {

impl SlackClientAdapter {
async fn post_message(&self, message: SlackApiChatPostMessageRequest) {
let session = self.client.open_session(&self.config.token);
let token = SlackApiToken::new(self.config.token.clone().into());
let session = self.client.open_session(&token);

let post_chat_resp = session.chat_post_message(&message).await;
info!("post chat resp: {:#?}", &post_chat_resp);
Expand Down

0 comments on commit a727c4a

Please sign in to comment.