pub struct Slack(/* private fields */);Expand description
The type that handles a commonly used process of Slack App.
Implementations§
Source§impl Slack
impl Slack
Sourcepub fn new(creds: AppCredentials, config: Config) -> Self
pub fn new(creds: AppCredentials, config: Config) -> Self
The constructor.
Sourcepub fn client_secret(&self) -> &str
pub fn client_secret(&self) -> &str
Returns the Slack Client App secret.
Sourcepub fn verification_token(&self, body: &SlashCommandBody) -> Result<(), Error>
pub fn verification_token(&self, body: &SlashCommandBody) -> Result<(), Error>
Returns Ok(()) if token from args matches the Slack App’s Verification Token.
Sourcepub fn validate_request(
&self,
signature: &str,
timestamp: &str,
body: &[u8],
) -> Result<(), Error>
pub fn validate_request( &self, signature: &str, timestamp: &str, body: &[u8], ) -> Result<(), Error>
Validates the request from Slack.
https://api.slack.com/authentication/verifying-requests-from-slack
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Slack
impl RefUnwindSafe for Slack
impl Send for Slack
impl Sync for Slack
impl Unpin 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