From 5b608b46e9a9aac882e6c039f20bf8065ba0c9cc Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Fri, 20 Jan 2023 12:36:43 +0100 Subject: [PATCH] [editor] Add notification in case bot is missing default-scopes Signed-off-by: Knut Ahlers --- configEditor.go | 2 ++ src/generalConfig.vue | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/configEditor.go b/configEditor.go index 3c6ee83..428f555 100644 --- a/configEditor.go +++ b/configEditor.go @@ -55,12 +55,14 @@ func registerEditorFrontend() { router.HandleFunc("/editor/vars.json", func(w http.ResponseWriter, r *http.Request) { if err := json.NewEncoder(w).Encode(struct { + DefaultBotScopes []string IRCBadges []string KnownEvents []*string TemplateFunctions []string TwitchClientID string Version string }{ + DefaultBotScopes: botDefaultScopes, IRCBadges: twitch.KnownBadges, KnownEvents: knownEvents, TemplateFunctions: tplFuncs.GetFuncNames(), diff --git a/src/generalConfig.vue b/src/generalConfig.vue index c43f780..534b4ff 100644 --- a/src/generalConfig.vue +++ b/src/generalConfig.vue @@ -268,6 +268,17 @@
  • Open the copied URL, sign in with the bot account and accept the permissions
  • The bot will display a message containing the authorized account. If this account is wrong, just start over, the token will be overwritten.
  • +

    + + Bot is missing {{ botMissingScopes }} of its default scopes, please re-authorize the bot. +

    ({ text: this.authURLs.available_extended_scopes[v], value: v }))