From b6feb6a0a24ccb8fa76e994ac1a3b51de875ca81 Mon Sep 17 00:00:00 2001 From: Luther Wen Xu Date: Sat, 19 Oct 2019 22:48:40 +0800 Subject: [PATCH] go: discord/backend: Remove some bias from trust score calculation --- GoBot/discord/backend/trust.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GoBot/discord/backend/trust.go b/GoBot/discord/backend/trust.go index ab533fe..4545390 100644 --- a/GoBot/discord/backend/trust.go +++ b/GoBot/discord/backend/trust.go @@ -34,7 +34,9 @@ func GetTrust(s *discordgo.Session, discordID string) (float64, error) { if err != nil { return 0.0, err } - votes = append(votes, 3) + if len(votes) == 0 { + return 0.0, nil + } var total float64 for _, v := range votes { total += float64(v)