1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-12-08 04:57:19 +00:00

Compare commits

...

4 commits

Author SHA1 Message Date
dependabot[bot] da7147dcc3
Merge d5a8433c00 into eabc1be595 2025-09-08 08:38:21 -07:00
Ayyan eabc1be595
discord: Fix SystemChannelFlags type
* fix(discord): modify internal type of SystemChannelFlags to uint16
* feat(discord): add new consts to SystemChannelFlags type
2025-09-03 23:44:07 -07:00
Ayyan e93079e2de
gateway!: Add ability to set custom identify properties (#483)
* feat(gateway): add {Bot,User}IdentifyProperties
* refactor(gateway): rename BotIdentifyProperties to BasicIdentifyProperties
* feat(gateway): use hash map for IdentifyProperties

this is a breaking change.
2025-09-03 18:59:50 -07:00
dependabot[bot] d5a8433c00
build(deps): bump golang.org/x/time from 0.10.0 to 0.11.0
Bumps [golang.org/x/time](https://github.com/golang/time) from 0.10.0 to 0.11.0.
- [Commits](https://github.com/golang/time/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: golang.org/x/time
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-05 18:53:50 +00:00
4 changed files with 27 additions and 27 deletions

View file

@ -29,7 +29,7 @@ const (
ElevatedMFA
)
type SystemChannelFlags uint8
type SystemChannelFlags uint16
// https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
const (
@ -37,6 +37,14 @@ const (
SuppressJoinNotifications SystemChannelFlags = 1 << iota
// SuppressPremiumSubscriptions suppresses server boost notifications.
SuppressPremiumSubscriptions
// SuppressGuildReminderNotifications suppresses server setup tips.
SuppressGuildReminderNotifications
// SuppressJoinNotificationReplies hides member join sticker reply buttons.
SuppressJoinNotificationReplies
// SuppressRoleSubscriptionPurchaseNotifications suppresses role subscription purchase and renewal notifications.
SuppressRoleSubscriptionPurchaseNotifications
// SuppressRoleSubscriptionPurchaseNotificationReplies hides role subscription sticker reply buttons.
SuppressRoleSubscriptionPurchaseNotificationReplies
)
type GuildFeature string

View file

@ -94,14 +94,25 @@ func (id *Identifier) QueryGateway(ctx context.Context) (gatewayURL string, err
return
}
const (
IdentifyOS IdentifyPropertyKey = "os"
IdentifyBrowser IdentifyPropertyKey = "browser"
IdentifyDevice IdentifyPropertyKey = "device"
)
// DefaultIdentity is used as the default identity when initializing a new
// Gateway.
var DefaultIdentity = IdentifyProperties{
OS: runtime.GOOS,
Browser: "Arikawa",
Device: "Arikawa",
IdentifyOS: runtime.GOOS,
IdentifyBrowser: "Arikawa",
IdentifyDevice: "Arikawa",
}
type (
IdentifyPropertyKey string
IdentifyProperties map[IdentifyPropertyKey]any
)
// IdentifyCommand is a command for Op 2. It is the struct for a data that's
// sent over in an Identify command.
type IdentifyCommand struct {
@ -176,26 +187,6 @@ func (i *IdentifyCommand) HasIntents(intents Intents) bool {
return Intents(*i.Intents).Has(intents)
}
type IdentifyProperties struct {
// Required
OS string `json:"os"` // GOOS
Browser string `json:"browser"` // Arikawa
Device string `json:"device"` // Arikawa
// Optional (not applicable to bots)
ClientBuildNumber int `json:"client_build_number,omitempty"`
BrowserUserAgent string `json:"browser_user_agent,omitempty"`
BrowserVersion string `json:"browser_version,omitempty"`
OSVersion string `json:"os_version,omitempty"`
Referrer string `json:"referrer,omitempty"`
ReferrerCurrent string `json:"referrer_current,omitempty"`
ReferrerDomainCurrent string `json:"referrer_domain_current,omitempty"`
ReferringDomain string `json:"referring_domain,omitempty"`
ReleaseChannel string `json:"release_channel,omitempty"`
SystemLocale discord.Language `json:"system_locale,omitempty"`
HasClientMods bool `json:"has_client_mods,omitempty"`
}
// Shard is a type for two numbers that represent the Bot's shard configuration.
// The first number is the shard's ID, which could be obtained through the
// ShardID method. The second number is the total number of shards, which could

3
go.mod
View file

@ -1,12 +1,13 @@
module github.com/diamondburned/arikawa/v3
go 1.23
toolchain go1.23.6
require (
github.com/gorilla/schema v1.4.1
github.com/gorilla/websocket v1.5.3
golang.org/x/crypto v0.32.0
golang.org/x/time v0.10.0
golang.org/x/time v0.11.0
)
require golang.org/x/sys v0.29.0 // indirect

4
go.sum
View file

@ -6,5 +6,5 @@ golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4=
golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0=
golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=