1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-12-01 03:03:48 +00:00
arikawa/discord/channel.go

69 lines
1.8 KiB
Go
Raw Normal View History

package discord
type Channel struct {
ID Snowflake `json:"id,string"`
Type ChannelType `json:"type"`
// Fields below may not appear
GuildID Snowflake `json:"guild_id,string,omitempty"`
Position int `json:"position,omitempty"`
Name string `json:"name,omitempty"` // 2-100 chars
Topic string `json:"topic,omitempty"` // 0-1024 chars
NSFW bool `json:"nsfw"`
Icon Hash `json:"icon,omitempty"`
// Direct Messaging fields
2020-01-04 04:19:24 +00:00
DMOwnerID Snowflake `json:"owner_id,string,omitempty"`
DMRecipients []User `json:"recipients,omitempty"`
// AppID of the group DM creator if it's bot-created
2020-01-04 04:19:24 +00:00
AppID Snowflake `json:"application_id,string,omitempty"`
// ID of the category the channel is in, if any.
2020-01-04 04:19:24 +00:00
CategoryID Snowflake `json:"parent_id,string,omitempty"`
LastPinTime Timestamp `json:"last_pin_timestamp,omitempty"`
// Explicit permission overrides for members and roles.
Permissions []Overwrite `json:"permission_overwrites,omitempty"`
// ID of the last message, may not point to a valid one.
2020-01-04 04:19:24 +00:00
LastMessageID Snowflake `json:"last_message_id,string,omitempty"`
// Slow mode duration. Bots and people with "manage_messages" or
// "manage_channel" permissions are unaffected.
UserRateLimit Seconds `json:"rate_limit_per_user,omitempty"`
// Voice, so GuildVoice only
2020-01-05 07:50:22 +00:00
VoiceBitrate uint `json:"bitrate,omitempty"`
VoiceUserLimit uint `json:"user_limit,omitempty"`
}
type ChannelType uint8
const (
GuildText ChannelType = iota
DirectMessage
GuildVoice
GroupDM
GuildCategory
GuildNews
GuildStore
)
type Overwrite struct {
2020-01-04 04:19:24 +00:00
ID Snowflake `json:"id,string,omitempty"`
Type OverwriteType `json:"type"`
2020-01-04 04:19:24 +00:00
Allow Permissions `json:"allow"`
Deny Permissions `json:"deny"`
}
type OverwriteType string
const (
OverwriteRole OverwriteType = "role"
OverwriteMember OverwriteType = "member"
)