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 11, 2022
1 parent 93035c9 commit 93bc872
Showing 1 changed file with 53 additions and 38 deletions.
91 changes: 53 additions & 38 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 Down Expand Up @@ -171,6 +181,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 +238,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 +294,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 93bc872

Please sign in to comment.