pub struct Slack { /* private fields */ }Expand description
Slack via the Events API: app_mention (and, unless mention-only, direct
messages) in; chat.postMessage out, threaded.
Secrets: SLACK_BOT_TOKEN to post, SLACK_SIGNING_SECRET to verify
requests. Without the token, replies are printed instead of posted, which
is what dev wants.
Implementations§
Source§impl Slack
impl Slack
Sourcepub fn from_secrets() -> Self
pub fn from_secrets() -> Self
Read credentials from the host-provided secrets.
Sourcepub fn mention_only(self) -> Self
pub fn mention_only(self) -> Self
Only respond when the bot is @-mentioned.
Trait Implementations§
Source§impl Channel for Slack
impl Channel for Slack
Source§fn receive<'life0, 'async_trait>(
&'life0 self,
inbound: Inbound,
) -> Pin<Box<dyn Future<Output = Result<ChannelEvent>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive<'life0, 'async_trait>(
&'life0 self,
inbound: Inbound,
) -> Pin<Box<dyn Future<Output = Result<ChannelEvent>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Interpret one webhook.
Auto Trait Implementations§
impl Freeze for Slack
impl RefUnwindSafe for Slack
impl Send for Slack
impl Sync for Slack
impl Unpin for Slack
impl UnsafeUnpin for Slack
impl UnwindSafe for Slack
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more