From 38b2d4d2b466f0f4a19bb4d0ebc2afc7480e5e7a Mon Sep 17 00:00:00 2001 From: mavolin <48887425+mavolin@users.noreply.github.com> Date: Sat, 16 May 2020 22:36:46 +0200 Subject: [PATCH] State: fix errors not returned --- state/state.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/state/state.go b/state/state.go index f4183c9..076de48 100644 --- a/state/state.go +++ b/state/state.go @@ -122,14 +122,14 @@ func (s *State) MemberDisplayName(guildID, userID discord.Snowflake) (string, er } func (s *State) AuthorColor(message *gateway.MessageCreateEvent) (discord.Color, error) { - if !message.GuildID.Valid() { - return 0, nil + if !message.GuildID.Valid() { // this is a dm + return discord.DefaultMemberColor, nil } if message.Member != nil { guild, err := s.Guild(message.GuildID) if err != nil { - return 0, nil + return 0, err } return discord.MemberColor(*guild, *message.Member), nil }