Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InteractionCallback's User object is missing username #1218

Open
irgraham534 opened this issue Jul 18, 2023 · 0 comments
Open

InteractionCallback's User object is missing username #1218

irgraham534 opened this issue Jul 18, 2023 · 0 comments

Comments

@irgraham534
Copy link

slack/interactions.go

Lines 35 to 71 in c4095cb

type InteractionCallback struct {
Type InteractionType `json:"type"`
Token string `json:"token"`
CallbackID string `json:"callback_id"`
ResponseURL string `json:"response_url"`
TriggerID string `json:"trigger_id"`
ActionTs string `json:"action_ts"`
Team Team `json:"team"`
Channel Channel `json:"channel"`
User User `json:"user"`
OriginalMessage Message `json:"original_message"`
Message Message `json:"message"`
Name string `json:"name"`
Value string `json:"value"`
MessageTs string `json:"message_ts"`
AttachmentID string `json:"attachment_id"`
ActionCallback ActionCallbacks `json:"actions"`
View View `json:"view"`
ActionID string `json:"action_id"`
APIAppID string `json:"api_app_id"`
BlockID string `json:"block_id"`
Container Container `json:"container"`
Enterprise Enterprise `json:"enterprise"`
WorkflowStep InteractionWorkflowStep `json:"workflow_step"`
DialogSubmissionCallback
ViewSubmissionCallback
ViewClosedCallback
// FIXME(kanata2): just workaround for backward-compatibility.
// See also https://github.com/slack-go/slack/issues/816
RawState json.RawMessage `json:"state,omitempty"`
// BlockActionState stands for the `state` field in block_actions type.
// NOTE: InteractionCallback.State has a role for the state of dialog_submission type,
// so we cannot use this field for backward-compatibility for now.
BlockActionState *BlockActionStates `json:"-"`
}

slack/users.go

Lines 112 to 139 in c4095cb

type User struct {
ID string `json:"id"`
TeamID string `json:"team_id"`
Name string `json:"name"`
Deleted bool `json:"deleted"`
Color string `json:"color"`
RealName string `json:"real_name"`
TZ string `json:"tz,omitempty"`
TZLabel string `json:"tz_label"`
TZOffset int `json:"tz_offset"`
Profile UserProfile `json:"profile"`
IsBot bool `json:"is_bot"`
IsAdmin bool `json:"is_admin"`
IsOwner bool `json:"is_owner"`
IsPrimaryOwner bool `json:"is_primary_owner"`
IsRestricted bool `json:"is_restricted"`
IsUltraRestricted bool `json:"is_ultra_restricted"`
IsStranger bool `json:"is_stranger"`
IsAppUser bool `json:"is_app_user"`
IsInvitedUser bool `json:"is_invited_user"`
Has2FA bool `json:"has_2fa"`
TwoFactorType *string `json:"two_factor_type"`
HasFiles bool `json:"has_files"`
Presence string `json:"presence"`
Locale string `json:"locale"`
Updated JSONTime `json:"updated"`
Enterprise EnterpriseUser `json:"enterprise_user,omitempty"`
}

Description

According to Slack's documentation for shortcuts and block_actions, the user object contained within the payload shown in the example should have username.

Regarding the shortcuts, specifically referring to the global shortcut example:

{
  "type": "shortcut",
  "token": "XXXXXXXXXXXXX",
  "action_ts": "1581106241.371594",
  "team": {
    "id": "TXXXXXXXX",
    "domain": "shortcuts-test"
  },
  "user": {
    "id": "UXXXXXXXXX",
    "username": "aman",
    "team_id": "TXXXXXXXX"
  },
  "callback_id": "shortcut_create_task",
  "trigger_id": "944799105734.773906753841.38b5894552bdd4a780554ee59d1f3638"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant