1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-11-23 13:14:16 +00:00

Discord: EditedTimestamp no longer a pointer

This commit is contained in:
diamondburned (Forefront) 2020-02-10 20:26:22 -08:00
parent f33dc2ee75
commit 60f1963c4b
3 changed files with 13 additions and 5 deletions

View file

@ -188,9 +188,15 @@ func MemberColor(guild Guild, member Member) Color {
var pos int
for _, r := range guild.Roles {
if r.Color > 0 && r.Position > pos {
c = r.Color
pos = r.Position
for _, mr := range member.RoleIDs {
if mr != r.ID {
continue
}
if r.Color > 0 && r.Position > pos {
c = r.Color
pos = r.Position
}
}
}

View file

@ -20,8 +20,8 @@ type Message struct {
Content string `json:"content"`
Timestamp Timestamp `json:"timestamp,omitempty"`
EditedTimestamp *Timestamp `json:"edited_timestamp,omitempty"`
Timestamp Timestamp `json:"timestamp,omitempty"`
EditedTimestamp Timestamp `json:"edited_timestamp,omitempty"`
TTS bool `json:"tts"`
Pinned bool `json:"pinned"`

View file

@ -6,6 +6,8 @@ import (
"time"
)
// Timestamp has a valid zero-value, which can be checked using the Valid()
// method. This is useful for optional timestamps such as EditedTimestamp.
type Timestamp time.Time
const TimestampFormat = time.RFC3339 // same as ISO8601