From 3d401d97516602d4e79f7e68c7b08d58ba286b8e Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sun, 16 Jul 2023 22:27:50 -0600 Subject: [PATCH] generalized status type config key instead of useMobile --- main.go | 24 +++++++++++------------- state/main.go | 4 ++-- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/main.go b/main.go index e8f4a7f..8a98643 100644 --- a/main.go +++ b/main.go @@ -83,20 +83,18 @@ func main() { client.Identify.Intents = discordgo.IntentsAll - if config["useMobile"] == "true" { - client.Identify.Properties = discordgo.IdentifyProperties{ - OS: "Android", - Browser: "Discord Android", - Device: "Pixel, raven", - } + client.Identify.Properties = discordgo.IdentifyProperties{ + OS: runtime.GOOS, + } + statusType := config["statusType"] + if statusType == "mobile" { + client.Identify.Properties.Browser = "Discord Android" + } else if statusType == "embedded" { + client.Identify.Properties.Browser = "Discord Embedded" + } else if statusType == "desktop" { + client.Identify.Properties.Browser = "Discord Client" } else { - // TODO: figure out how tempermental X-Super-Properties is, as in if it - // allows arbitrary values or not - client.Identify.Properties = discordgo.IdentifyProperties{ - OS: runtime.GOOS, - Browser: "comcord", - Device: "comcord", - } + client.Identify.Properties.Browser = "comcord" } status := "online" diff --git a/state/main.go b/state/main.go index c46d09d..2949db8 100644 --- a/state/main.go +++ b/state/main.go @@ -1,9 +1,9 @@ package state import ( - "time" + "time" - "github.com/bwmarrin/discordgo" + "github.com/bwmarrin/discordgo" ) type ComcordState struct {