Don't return errors from Logout

This commit is contained in:
Tulir Asokan
2022-11-26 15:18:42 +02:00
parent 96a0351c68
commit 89985740fd
3 changed files with 24 additions and 58 deletions

View File

@@ -201,15 +201,15 @@ var cmdLogout = &commands.FullHandler{
Section: commands.HelpSectionAuth,
Description: "Forget the stored Discord auth token.",
},
RequiresLogin: true,
}
func fnLogout(ce *WrappedCommandEvent) {
err := ce.User.Logout()
if err != nil {
ce.Reply("Error logging out: %v", err)
} else {
wasLoggedIn := ce.User.DiscordID != ""
ce.User.Logout()
if wasLoggedIn {
ce.Reply("Logged out successfully.")
} else {
ce.Reply("You weren't logged in, but data was re-cleared just to be safe.")
}
}