mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-07 12:38:05 +00:00
Discord: add docs
This commit is contained in:
parent
f4be7971ee
commit
68d3129bfd
|
@ -1,5 +1,6 @@
|
||||||
package discord
|
package discord
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/resources/guild#guild-object
|
||||||
type Guild struct {
|
type Guild struct {
|
||||||
// ID is the guild id.
|
// ID is the guild id.
|
||||||
ID Snowflake `json:"id,string"`
|
ID Snowflake `json:"id,string"`
|
||||||
|
@ -420,6 +421,7 @@ type Integration struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
} `json:"account"`
|
} `json:"account"`
|
||||||
|
|
||||||
|
// SyncedAt specifies when this integration was last synced.
|
||||||
SyncedAt Timestamp `json:"synced_at"`
|
SyncedAt Timestamp `json:"synced_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -434,6 +436,8 @@ type GuildWidget struct {
|
||||||
// DefaultMemberColor is the color used for members without colored roles.
|
// DefaultMemberColor is the color used for members without colored roles.
|
||||||
var DefaultMemberColor Color = 0x0
|
var DefaultMemberColor Color = 0x0
|
||||||
|
|
||||||
|
// MemberColor computes the effective color of the Member, taking into account
|
||||||
|
// the role colors.
|
||||||
func MemberColor(guild Guild, member Member) Color {
|
func MemberColor(guild Guild, member Member) Color {
|
||||||
var c = DefaultMemberColor
|
var c = DefaultMemberColor
|
||||||
var pos int
|
var pos int
|
||||||
|
|
|
@ -4,11 +4,15 @@ import (
|
||||||
"github.com/diamondburned/arikawa/utils/json/enum"
|
"github.com/diamondburned/arikawa/utils/json/enum"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Guild.MaxPresences is 5000 when it's 0.
|
// Guild.MaxPresences is this value when it's 0.
|
||||||
const DefaultMaxPresences = 5000
|
// This happens because the Discord API sends JSON null, if the MaxPresences
|
||||||
|
// reach DefaultMaxPresences, which in turn will be serialized into 0.
|
||||||
|
const DefaultMaxPresences = 25000
|
||||||
|
|
||||||
|
// NitroBoost is the premium tier (Server Boost level).
|
||||||
type NitroBoost uint8
|
type NitroBoost uint8
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
|
||||||
const (
|
const (
|
||||||
NoNitroLevel NitroBoost = iota
|
NoNitroLevel NitroBoost = iota
|
||||||
NitroLevel1
|
NitroLevel1
|
||||||
|
@ -16,46 +20,64 @@ const (
|
||||||
NitroLevel3
|
NitroLevel3
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// MFALevel is the required MFA level for a guild.
|
||||||
type MFALevel uint8
|
type MFALevel uint8
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
|
||||||
const (
|
const (
|
||||||
NoMFA MFALevel = iota
|
NoMFA MFALevel = iota
|
||||||
ElevatedMFA
|
ElevatedMFA
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type SystemChannelFlags uint8
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||||
|
const (
|
||||||
|
// SuppressJoinNotifications suppresses member join notifications.
|
||||||
|
SuppressJoinNotifications SystemChannelFlags = 1 << iota
|
||||||
|
// SuppressPremiumSubscriptions suppresses server boost notifications.
|
||||||
|
SuppressPremiumSubscriptions
|
||||||
|
)
|
||||||
|
|
||||||
type GuildFeature string
|
type GuildFeature string
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||||
const (
|
const (
|
||||||
// Guild has access to set an invite splash background
|
// InviteSplash is set, if the guild has access to set an invite splash
|
||||||
|
// background.
|
||||||
InviteSplash GuildFeature = "INVITE_SPLASH"
|
InviteSplash GuildFeature = "INVITE_SPLASH"
|
||||||
// Guild has access to set 384kbps bitrate in voice (previously VIP voice
|
// VIPRegions is set, if the guild has access to set 384kbps bitrate in
|
||||||
// servers)
|
// voice (previously VIP voice servers).
|
||||||
VIPRegions GuildFeature = "VIP_REGIONS"
|
VIPRegions GuildFeature = "VIP_REGIONS"
|
||||||
// Guild has access to set a vanity URL
|
// VanityURL is set, if the guild has access to set a vanity URL.
|
||||||
VanityURL GuildFeature = "VANITY_URL"
|
VanityURL GuildFeature = "VANITY_URL"
|
||||||
// Guild is verified
|
// Verified is set, if the guild is verified.
|
||||||
Verified GuildFeature = "VERIFIED"
|
Verified GuildFeature = "VERIFIED"
|
||||||
// Guild is partnered
|
// Partnered is set, if the guild is partnered.
|
||||||
Partnered GuildFeature = "PARTNERED"
|
Partnered GuildFeature = "PARTNERED"
|
||||||
// Guild is public
|
// Public is set, if the guild is public.
|
||||||
Public GuildFeature = "PUBLIC"
|
Public GuildFeature = "PUBLIC"
|
||||||
// Guild has access to use commerce features (i.e. create store channels)
|
// Commerce is set, if the guild has access to use commerce features
|
||||||
|
// (i.e. create store channels).
|
||||||
Commerce GuildFeature = "COMMERCE"
|
Commerce GuildFeature = "COMMERCE"
|
||||||
// Guild has access to create news channels
|
// News is set, if the guild has access to create news channels.
|
||||||
News GuildFeature = "NEWS"
|
News GuildFeature = "NEWS"
|
||||||
// Guild is able to be discovered in the directory
|
// Discoverable is set, if the guild is able to be discovered in the
|
||||||
|
// directory.
|
||||||
Discoverable GuildFeature = "DISCOVERABLE"
|
Discoverable GuildFeature = "DISCOVERABLE"
|
||||||
// Guild is able to be featured in the directory
|
// Featurable is set, if the guild is able to be featured in the directory.
|
||||||
Featurable GuildFeature = "FEATURABLE"
|
Featurable GuildFeature = "FEATURABLE"
|
||||||
// Guild has access to set an animated guild icon
|
// AnimatedIcon is set, if the guild has access to set an animated guild
|
||||||
|
// icon.
|
||||||
AnimatedIcon GuildFeature = "ANIMATED_ICON"
|
AnimatedIcon GuildFeature = "ANIMATED_ICON"
|
||||||
// Guild has access to set a guild banner image
|
// Banner is set, if the guild has access to set a guild banner image.
|
||||||
Banner GuildFeature = "BANNER"
|
Banner GuildFeature = "BANNER"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExplicitFilter is the explicit content filter level of a guild.
|
// ExplicitFilter is the explicit content filter level of a guild.
|
||||||
type ExplicitFilter enum.Enum
|
type ExplicitFilter enum.Enum
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||||
var (
|
var (
|
||||||
// NullExplicitFilter serialized to JSON null.
|
// NullExplicitFilter serialized to JSON null.
|
||||||
// This should only be used on nullable fields.
|
// This should only be used on nullable fields.
|
||||||
|
@ -82,6 +104,7 @@ func (f ExplicitFilter) MarshalJSON() ([]byte, error) {
|
||||||
// Notification is the default message notification level of a guild.
|
// Notification is the default message notification level of a guild.
|
||||||
type Notification enum.Enum
|
type Notification enum.Enum
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||||
var (
|
var (
|
||||||
// NullNotification serialized to JSON null.
|
// NullNotification serialized to JSON null.
|
||||||
// This should only be used on nullable fields.
|
// This should only be used on nullable fields.
|
||||||
|
@ -104,6 +127,7 @@ func (n Notification) MarshalJSON() ([]byte, error) { return enum.ToJSON(enum.En
|
||||||
// Verification is the verification level required for a guild.
|
// Verification is the verification level required for a guild.
|
||||||
type Verification enum.Enum
|
type Verification enum.Enum
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||||
var (
|
var (
|
||||||
// NullVerification serialized to JSON null.
|
// NullVerification serialized to JSON null.
|
||||||
// This should only be used on nullable fields.
|
// This should only be used on nullable fields.
|
||||||
|
@ -143,6 +167,7 @@ const (
|
||||||
// ExpireBehavior is the integration expire behavior that regulates what happens, if a subscriber expires.
|
// ExpireBehavior is the integration expire behavior that regulates what happens, if a subscriber expires.
|
||||||
type ExpireBehavior uint8
|
type ExpireBehavior uint8
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||||
var (
|
var (
|
||||||
// RemoveRole removes the role of the subscriber.
|
// RemoveRole removes the role of the subscriber.
|
||||||
RemoveRole ExpireBehavior = 0
|
RemoveRole ExpireBehavior = 0
|
||||||
|
|
Loading…
Reference in a new issue