1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-28 17:53:30 +00:00

State: fix errors not returned

This commit is contained in:
mavolin 2020-05-16 22:36:46 +02:00
parent 9ce1a967d8
commit 38b2d4d2b4
No known key found for this signature in database
GPG key ID: D8681218EDF216DF

View file

@ -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
}