mirror of
https://github.com/System-End/slack-morphism-rust.git
synced 2026-04-19 23:22:56 +00:00
Basic support for SlackEnterpriseUser information (#216)
This commit is contained in:
parent
0da33a569c
commit
0b44ac657d
3 changed files with 23 additions and 3 deletions
|
|
@ -29,13 +29,18 @@ async fn test_command_events_function(
|
|||
.api_test(&SlackApiTestRequest::new().with_foo("Test".into()))
|
||||
.await?;
|
||||
|
||||
let user_info_resp = session
|
||||
.users_info(&SlackApiUsersInfoRequest::new(event.user_id.clone()))
|
||||
.await?;
|
||||
|
||||
Ok(SlackCommandEventResponse::new(
|
||||
SlackMessageContent::new()
|
||||
.with_text("Working on it".into())
|
||||
.with_text(format!("Working on it: {:?}", user_info_resp.user.team_id).into())
|
||||
.with_blocks(slack_blocks![
|
||||
some_into(SlackSectionBlock::new().with_text(md!(
|
||||
"Working section for {}",
|
||||
event.user_id.to_slack_format()
|
||||
"Working section for {}. Team ID: {:?}",
|
||||
event.user_id.to_slack_format(),
|
||||
user_info_resp.user.teams
|
||||
))),
|
||||
some_into(SlackActionsBlock::new(slack_blocks![
|
||||
some_into(SlackBlockButtonElement::new(
|
||||
|
|
|
|||
|
|
@ -237,3 +237,6 @@ pub enum SlackShortcutType {
|
|||
|
||||
#[derive(Debug, Eq, PartialEq, Hash, Clone, Serialize, Deserialize, ValueStruct)]
|
||||
pub struct SlackEventType(pub String);
|
||||
|
||||
#[derive(Debug, Eq, Hash, PartialEq, Clone, Serialize, Deserialize, ValueStruct)]
|
||||
pub struct SlackEnterpriseId(pub String);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ pub struct SlackUser {
|
|||
pub deleted: Option<bool>,
|
||||
pub color: Option<SlackColor>,
|
||||
pub real_name: Option<String>,
|
||||
pub enterprise_user: Option<SlackEnterpriseUser>,
|
||||
}
|
||||
|
||||
#[skip_serializing_none]
|
||||
|
|
@ -113,3 +114,14 @@ pub struct SlackUserGroupPrefs {
|
|||
|
||||
#[derive(Debug, Eq, PartialEq, Hash, Clone, Serialize, Deserialize, ValueStruct)]
|
||||
pub struct SlackAvatarHash(pub String);
|
||||
|
||||
#[skip_serializing_none]
|
||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
|
||||
pub struct SlackEnterpriseUser {
|
||||
pub id: SlackUserId,
|
||||
pub enterprise_id: SlackEnterpriseId,
|
||||
pub enterprise_name: Option<String>,
|
||||
#[serde(flatten)]
|
||||
pub flags: SlackUserFlags,
|
||||
pub teams: Option<Vec<SlackTeamId>>,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue