diff --git a/chatreplica/convert.go b/chatreplica/convert.go index e87901f..be08539 100644 --- a/chatreplica/convert.go +++ b/chatreplica/convert.go @@ -29,11 +29,16 @@ func FromArchiveMessages(messages []message.Message, ticketId int) Payload { // Add user to entities map snowflake := strconv.FormatUint(msg.Author.Id, 10) if _, ok := users[snowflake]; !ok { + var badge *Badge + if msg.Author.Bot { + badge = badgePtr(BadgeBot) + } + users[snowflake] = User{ Avatar: msg.Author.AvatarUrl(256), Username: msg.Author.Username, Discriminator: msg.Author.Discriminator, - Badge: nil, + Badge: badge, } } } diff --git a/chatreplica/structs.go b/chatreplica/structs.go index 85c5320..8e18a17 100644 --- a/chatreplica/structs.go +++ b/chatreplica/structs.go @@ -53,3 +53,7 @@ type Badge string const ( BadgeBot Badge = "bot" ) + +func badgePtr(b Badge) *Badge { + return &b +}