generalized status type config key instead of useMobile

This commit is contained in:
Cynthia Foxwell 2023-07-16 22:27:50 -06:00
parent 1a667b43d4
commit 3d401d9751
2 changed files with 13 additions and 15 deletions

24
main.go
View file

@ -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"

View file

@ -1,9 +1,9 @@
package state
import (
"time"
"time"
"github.com/bwmarrin/discordgo"
"github.com/bwmarrin/discordgo"
)
type ComcordState struct {