Skip to content

Commit

Permalink
Add missing EventTimestamp field on some inner events
Browse files Browse the repository at this point in the history
  • Loading branch information
abustany committed Apr 8, 2022
1 parent 93035c9 commit 5dcc5fa
Showing 1 changed file with 59 additions and 42 deletions.
101 changes: 59 additions & 42 deletions slackevents/inner_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,39 @@ type ChannelCreatedEvent struct {

// ChannelDeletedEvent represents the Channel deleted event
type ChannelDeletedEvent struct {
Type string `json:"type"`
Channel string `json:"channel"`
Type string `json:"type"`
Channel string `json:"channel"`
EventTimestamp string `json:"event_ts"`
}

// ChannelArchiveEvent represents the Channel archive event
type ChannelArchiveEvent struct {
Type string `json:"type"`
Channel string `json:"channel"`
User string `json:"user"`
Type string `json:"type"`
Channel string `json:"channel"`
User string `json:"user"`
EventTimestamp string `json:"event_ts"`
}

// ChannelUnarchiveEvent represents the Channel unarchive event
type ChannelUnarchiveEvent struct {
Type string `json:"type"`
Channel string `json:"channel"`
User string `json:"user"`
Type string `json:"type"`
Channel string `json:"channel"`
User string `json:"user"`
EventTimestamp string `json:"event_ts"`
}

// ChannelLeftEvent represents the Channel left event
type ChannelLeftEvent struct {
Type string `json:"type"`
Channel string `json:"channel"`
Type string `json:"type"`
Channel string `json:"channel"`
EventTimestamp string `json:"event_ts"`
}

// ChannelRenameEvent represents the Channel rename event
type ChannelRenameEvent struct {
Type string `json:"type"`
Channel ChannelRenameInfo `json:"channel"`
Type string `json:"type"`
Channel ChannelRenameInfo `json:"channel"`
EventTimestamp string `json:"event_ts"`
}

// ChannelIDChangedEvent represents the Channel identifier changed event
Expand Down Expand Up @@ -112,32 +117,37 @@ type ChannelRenameInfo struct {

// GroupDeletedEvent represents the Group deleted event
type GroupDeletedEvent struct {
Type string `json:"type"`
Channel string `json:"channel"`
Type string `json:"type"`
Channel string `json:"channel"`
EventTimestamp string `json:"event_ts"`
}

// GroupArchiveEvent represents the Group archive event
type GroupArchiveEvent struct {
Type string `json:"type"`
Channel string `json:"channel"`
Type string `json:"type"`
Channel string `json:"channel"`
EventTimestamp string `json:"event_ts"`
}

// GroupUnarchiveEvent represents the Group unarchive event
type GroupUnarchiveEvent struct {
Type string `json:"type"`
Channel string `json:"channel"`
Type string `json:"type"`
Channel string `json:"channel"`
EventTimestamp string `json:"event_ts"`
}

// GroupLeftEvent represents the Group left event
type GroupLeftEvent struct {
Type string `json:"type"`
Channel string `json:"channel"`
Type string `json:"type"`
Channel string `json:"channel"`
EventTimestamp string `json:"event_ts"`
}

// GroupRenameEvent represents the Group rename event
type GroupRenameEvent struct {
Type string `json:"type"`
Channel GroupRenameInfo `json:"channel"`
Type string `json:"type"`
Channel GroupRenameInfo `json:"channel"`
EventTimestamp string `json:"event_ts"`
}

// GroupRenameInfo represents the information associated with the Group rename event
Expand All @@ -149,14 +159,16 @@ type GroupRenameInfo struct {

// GridMigrationFinishedEvent An enterprise grid migration has finished on this workspace.
type GridMigrationFinishedEvent struct {
Type string `json:"type"`
EnterpriseID string `json:"enterprise_id"`
Type string `json:"type"`
EnterpriseID string `json:"enterprise_id"`
EventTimestamp string `json:"event_ts"`
}

// GridMigrationStartedEvent An enterprise grid migration has started on this workspace.
type GridMigrationStartedEvent struct {
Type string `json:"type"`
EnterpriseID string `json:"enterprise_id"`
Type string `json:"type"`
EnterpriseID string `json:"enterprise_id"`
EventTimestamp string `json:"event_ts"`
}

// LinkSharedEvent A message was posted containing one or more links relevant to your application
Expand All @@ -171,6 +183,7 @@ type LinkSharedEvent struct {
MessageTimeStamp string `json:"message_ts"`
ThreadTimeStamp string `json:"thread_ts"`
Links []sharedLinks `json:"links"`
EventTimestamp string `json:"event_ts"`
}

type sharedLinks struct {
Expand Down Expand Up @@ -227,21 +240,23 @@ type MessageEvent struct {

// MemberJoinedChannelEvent A member joined a public or private channel
type MemberJoinedChannelEvent struct {
Type string `json:"type"`
User string `json:"user"`
Channel string `json:"channel"`
ChannelType string `json:"channel_type"`
Team string `json:"team"`
Inviter string `json:"inviter"`
Type string `json:"type"`
User string `json:"user"`
Channel string `json:"channel"`
ChannelType string `json:"channel_type"`
Team string `json:"team"`
Inviter string `json:"inviter"`
EventTimestamp string `json:"event_ts"`
}

// MemberLeftChannelEvent A member left a public or private channel
type MemberLeftChannelEvent struct {
Type string `json:"type"`
User string `json:"user"`
Channel string `json:"channel"`
ChannelType string `json:"channel_type"`
Team string `json:"team"`
Type string `json:"type"`
User string `json:"user"`
Channel string `json:"channel"`
ChannelType string `json:"channel_type"`
Team string `json:"team"`
EventTimestamp string `json:"event_ts"`
}

type pinEvent struct {
Expand Down Expand Up @@ -281,14 +296,16 @@ type tokens struct {

// TeamJoinEvent A new member joined a workspace - https://api.slack.com/events/team_join
type TeamJoinEvent struct {
Type string `json:"type"`
User *slack.User `json:"user"`
Type string `json:"type"`
User *slack.User `json:"user"`
EventTimestamp string `json:"event_ts"`
}

// TokensRevokedEvent APP's API tokes are revoked - https://api.slack.com/events/tokens_revoked
// TokensRevokedEvent APP's API tokens are revoked - https://api.slack.com/events/tokens_revoked
type TokensRevokedEvent struct {
Type string `json:"type"`
Tokens tokens `json:"tokens"`
Type string `json:"type"`
Tokens tokens `json:"tokens"`
EventTimestamp string `json:"event_ts"`
}

// EmojiChangedEvent is the event of custom emoji has been added or changed
Expand Down

0 comments on commit 5dcc5fa

Please sign in to comment.