diff --git a/configEditor_general.go b/configEditor_general.go index 720266d..45deb8a 100644 --- a/configEditor_general.go +++ b/configEditor_general.go @@ -18,7 +18,7 @@ import ( type ( configEditorGeneralConfig struct { BotEditors []string `json:"bot_editors"` - BotName string `json:"bot_name"` + BotName *string `json:"bot_name,omitempty"` Channels []string `json:"channels"` ChannelHasScopes map[string]bool `json:"channel_has_scopes"` } @@ -189,10 +189,9 @@ func configEditorHandleGeneralGet(w http.ResponseWriter, r *http.Request) { elevated[ch] = store.UserHasGrantedScopes(ch, channelDefaultScopes...) } - uName, err := twitchClient.GetAuthorizedUsername() - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return + var uName *string + if n, err := twitchClient.GetAuthorizedUsername(); err == nil { + uName = &n } if err := json.NewEncoder(w).Encode(configEditorGeneralConfig{ diff --git a/src/generalConfig.vue b/src/generalConfig.vue index 3877e66..9c52ae5 100644 --- a/src/generalConfig.vue +++ b/src/generalConfig.vue @@ -222,13 +222,33 @@ /> Bot Connection - {{ generalConfig.bot_name }} - - Twitch Login-Name of the bot user currently authorized - + +