let discordgo handle custom status updating
also update discordgo version
MODIFY
go.mod
go.mod
@@ -4,7 +4,7 @@ go 1.12
require (
github.com/Bios-Marcel/discordemojimap v0.0.0-20190404160132-506fd0e8d912
- github.com/Bios-Marcel/discordgo v0.20.4-0.20191101185414-2d27b68262e6
+ github.com/Bios-Marcel/discordgo v0.20.5-0.20200107213334-6da23eee3010
github.com/Bios-Marcel/goclipimg v0.0.0-20190417192721-b58a8831f27d
github.com/Bios-Marcel/shortnotforlong v1.0.0
github.com/Bios-Marcel/tview v0.0.0-20191024171520-41147a2f8cf9

MODIFY
go.sum
go.sum
github.com/Bios-Marcel/discordemojimap v0.0.0-20190404160132-506fd0e8d912 h1:QxaGxuQTupp5haCZu+zuQoQ9JbiM13N5UiTSJpsuvh8=
github.com/Bios-Marcel/discordemojimap v0.0.0-20190404160132-506fd0e8d912/go.mod h1:D1W9gRQXP1UESEobmNIng2i+E8UvdDF4NJ9EOXn9Ano=
-github.com/Bios-Marcel/discordgo v0.20.4-0.20191012193840-26cddf403c14 h1:rMm2kL+lOb4eYdDexAsFV8dlEX+0V/Jkr05SZQpZ83E=
-github.com/Bios-Marcel/discordgo v0.20.4-0.20191012193840-26cddf403c14/go.mod h1:bLnfQU0j/SejmPozgW5GepmKvd8CrbMIml2I0IZENVE=
github.com/Bios-Marcel/discordgo v0.20.4-0.20191101185414-2d27b68262e6 h1:Ed7t7xaw30EJqu6jqpAwHBjjq3A+de5+7qUwEkzcfd0=
github.com/Bios-Marcel/discordgo v0.20.4-0.20191101185414-2d27b68262e6/go.mod h1:bLnfQU0j/SejmPozgW5GepmKvd8CrbMIml2I0IZENVE=
+github.com/Bios-Marcel/discordgo v0.20.5-0.20200107213334-6da23eee3010 h1:f6LsOhETyxf3lkxZ65nrDladW85pvDQ5OVMRZFNIY7I=
+github.com/Bios-Marcel/discordgo v0.20.5-0.20200107213334-6da23eee3010/go.mod h1:bLnfQU0j/SejmPozgW5GepmKvd8CrbMIml2I0IZENVE=
github.com/Bios-Marcel/goclipimg v0.0.0-20190417192721-b58a8831f27d h1:vfrX8l3fHuaP7gRgEc7mX/lHVTlfQcQeaIdSPmT6Ej0=
github.com/Bios-Marcel/goclipimg v0.0.0-20190417192721-b58a8831f27d/go.mod h1:u7z9t086HoIbA/uuoA2KcRDhKS47DRYCDZ39aegTR4c=
github.com/Bios-Marcel/shortnotforlong v1.0.0 h1:K4JJ5U3+D8LXoAiH0QbfMujWuqKo+NAEZKuQ2RHPqqE=

MODIFY
ui/login.go
ui/login.go
@@ -288,16 +288,14 @@ func (login *Login) attemptLogin() {
// Even if the login is supposed to be without two-factor-authentication, we
// attempt parsing a 2fa code, since the underlying rest-call can also handle
// non-2fa login calls.
- var mfaToken int64
- mfaTokenText := strings.ReplaceAll(login.tfaTokenInput.GetText(), " ", "")
- if mfaTokenText != "" {
- var parseError error
- mfaToken, parseError = strconv.ParseInt(mfaTokenText, 10, 32)
+ mfaToken := strings.ReplaceAll(login.tfaTokenInput.GetText(), " ", "")
+ if mfaToken != "" {
+ _, parseError := strconv.ParseInt(mfaToken, 10, 32)
if parseError != nil {
login.sessionChannel <- &loginAttempt{nil, errors.New("[red]Two-Factor-Authentication Code incorrect.\n\n[red]Correct example: 564 231")}
}
}
- session, loginError := discordgo.NewWithPasswordAndMFA(userAgent, login.usernameInput.GetText(), login.passwordInput.GetText(), int(mfaToken))
+ session, loginError := discordgo.NewWithPasswordAndMFA(userAgent, login.usernameInput.GetText(), login.passwordInput.GetText(), mfaToken)
login.sessionChannel <- &loginAttempt{session, loginError}
}

let discordgo handle custom status updating

also update discordgo version