mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-12-08 12:58:17 +00:00
Compare commits
4 commits
1f03c8ef66
...
0da6616ae8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0da6616ae8 | ||
|
|
eabc1be595 | ||
|
|
e93079e2de | ||
|
|
29f0a1ac5b |
|
|
@ -142,15 +142,16 @@ func (g Guild) IconURLWithType(t ImageType) string {
|
|||
}
|
||||
|
||||
// BannerURL returns the URL to the banner, which is the image on top of the
|
||||
// channels list. This will always return a link to a PNG file.
|
||||
// channels list. Auto detects a suitable image type. An empty string is
|
||||
// returned if the guild has no banner.
|
||||
func (g Guild) BannerURL() string {
|
||||
return g.BannerURLWithType(PNGImage)
|
||||
return g.BannerURLWithType(AutoImage)
|
||||
}
|
||||
|
||||
// BannerURLWithType returns the URL to the banner, which is the image on top
|
||||
// of the channels list using the passed image type.
|
||||
//
|
||||
// Supported ImageTypes: PNG, JPEG, WebP
|
||||
// Supported ImageTypes: PNG, JPEG, WebP, GIF
|
||||
func (g Guild) BannerURLWithType(t ImageType) string {
|
||||
if g.Banner == "" {
|
||||
return ""
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue