From d65ae5c840eef61d4688145b106a7cd07a442c81 Mon Sep 17 00:00:00 2001 From: Matthieu Lalonde Date: Thu, 28 Jan 2021 18:48:05 +0000 Subject: [PATCH] Small fix to privacy user option --- pkg/bot/handlers.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/bot/handlers.go b/pkg/bot/handlers.go index 3411df3..1ba7c9b 100644 --- a/pkg/bot/handlers.go +++ b/pkg/bot/handlers.go @@ -284,12 +284,16 @@ func (b *Type) handleUserPrivacy(ds *discordgo.Session, dm *discordgo.Message, c b.replyInvalidCommandFormat(ds, dm, ctx, "privacy") return } - pp := p[1:][0] + pp := strings.ToLower(p[1:][0]) if !utils.SliceContainsString([]string{"none", "join", "part", "status", "all"}, pp) { b.replyInvalidCommandFormat(ds, dm, ctx, "privacy") return } - uu.Privacy = userPrivacyFromString(pp) + if pp == userPrivacyNone.String() { + uu.Privacy = userPrivacyNone + } else { + upSet(uu.Privacy, userPrivacyFromString(pp)) + } b.dg.Session.ChannelMessageSendReply(dm.ChannelID, b.getMessageString("all_done", uu), &discordgo.MessageReference{