feat(config): add status field (#506)

Co-authored-by: ayn2op <ayn2op@mac.local>
This commit is contained in:
Ayyan 2025-02-22 21:57:51 -05:00 • committed by GitHub
parent 0f6e2c46d3
commit 2b151ca029
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 6 deletions

View file

@ -33,6 +33,10 @@ func openState(token string, app *tview.Application, cfg *config.Config) error {
BrowserUserAgent: cfg.UserAgent,
}
gateway.DefaultPresence = &gateway.UpdatePresenceCommand{
Status: cfg.Status,
}
discordState = &State{
State: ningen.New(token),
cfg: cfg,

View file

@ -8,15 +8,17 @@ import (
"github.com/BurntSushi/toml"
"github.com/ayn2op/discordo/internal/consts"
"github.com/diamondburned/arikawa/v3/discord"
)
type Config struct {
Mouse bool `toml:"mouse"`
HideBlockedUsers bool `toml:"hide_blocked_users"`
Timestamps bool `toml:"timestamps"`
ShowAttachmentLinks bool `toml:"show_attachment_links"`
MessagesLimit uint8 `toml:"messages_limit"`
Editor string `toml:"editor"`
Mouse bool `toml:"mouse"`
HideBlockedUsers bool `toml:"hide_blocked_users"`
Timestamps bool `toml:"timestamps"`
ShowAttachmentLinks bool `toml:"show_attachment_links"`
MessagesLimit uint8 `toml:"messages_limit"`
Editor string `toml:"editor"`
Status discord.Status `toml:"status"`
Browser string `toml:"browser"`
BrowserVersion string `toml:"browser_version"`
@ -36,6 +38,7 @@ func defaultConfig() *Config {
MessagesLimit: 50,
Editor: "default",
TimestampsFormat: time.Kitchen,
Status: discord.OnlineStatus,
Browser: consts.Browser,
BrowserVersion: consts.BrowserVersion,