Skip to content

Commit

Permalink
Fix notification timestsamp in Discord (#442)
Browse files Browse the repository at this point in the history
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug fix Pull Request

##### SUMMARY

Use correct timestamp in Discord event notification 

Fixes #441 

##### Test plan

![image](https://user-images.githubusercontent.com/7098659/103475090-43be1880-4dd0-11eb-9a5c-2406d2d4f954.png)
  • Loading branch information
PrasadG193 authored Jan 3, 2021
1 parent 24bdc7e commit bcd48cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/notify/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

// customTimeFormat holds custom time format string
const customTimeFormat = "2006-01-02 15:04:05"
const customTimeFormat = "2006-01-02T15:04:05Z"

var embedColor = map[config.Level]int{
config.Info: 8311585, // green
Expand Down Expand Up @@ -110,7 +110,7 @@ func formatDiscordMessage(event events.Event, notifyType config.NotifType) disco
}

// Add timestamp
messageEmbed.Timestamp = event.TimeStamp.Format(customTimeFormat)
messageEmbed.Timestamp = event.TimeStamp.UTC().Format(customTimeFormat)

messageEmbed.Color = embedColor[event.Level]

Expand Down

0 comments on commit bcd48cd

Please sign in to comment.