feat(config): add status field (#506)
Co-authored-by: ayn2op <ayn2op@mac.local>
This commit is contained in:
parent
0f6e2c46d3
commit
2b151ca029
2 changed files with 13 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue