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

discord: Add ChannelFlags (#345)

* added ChannelFlags

* Minor style fixes, comment additions

Co-authored-by: diamondburned <diamond@arikawa-hi.me>
This commit is contained in:
svenwiltink 2022-09-23 09:00:04 +02:00 committed by GitHub
parent 238a91b2fc
commit fa35b32b79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View file

@ -28,6 +28,8 @@ type CreateChannelData struct {
//
// Channel Types: Text, News
Topic string `json:"topic,omitempty"`
// Flags is a bitmask that contains if a thread is pinned for example
Flags discord.ChannelFlags `json:"flags,omitempty"`
// VoiceBitrate is the bitrate (in bits) of the voice channel.
// 8000 to 96000 (128000 for VIP servers)
//
@ -157,6 +159,8 @@ type ModifyChannelData struct {
//
// Channel Types: Text, News
Topic option.NullableString `json:"topic,omitempty"`
// Flags is a bitmask that contains if a thread is pinned for example
Flags *discord.ChannelFlags `json:"flags,omitempty"`
// NSFW specifies whether the channel is nsfw.
//
// Channel Types: Text, News, Store

View file

@ -9,6 +9,22 @@ import (
"github.com/diamondburned/arikawa/v3/utils/json/option"
)
// ChannelFlags are the channel flags combined as a bitfield.
type ChannelFlags uint64
const (
_ ChannelFlags = 1 << iota
// PinnedThread means this thread is pinned to the top of its parent
// GuildForum channel.
PinnedThread
_
_
// ThreadRequireTag is whether a tag is required to be specified when
// creating a thread in a GuildForum channel. Tags are specified in the
// AppliedTags field.
ThreadRequireTag
)
// Channel represents a guild or DM channel within Discord.
//
// https://discord.com/developers/docs/resources/channel#channel-object
@ -46,6 +62,9 @@ type Channel struct {
// VoiceUserLimit is the user limit of the voice channel.
VoiceUserLimit uint `json:"user_limit,omitempty"`
// Flags is a bitmask that contains if a thread is pinned, for example.
Flags ChannelFlags `json:"flags,omitempty"`
// UserRateLimit is the amount of seconds a user has to wait before sending
// another message (0-21600). Bots, as well as users with the permission
// manage_messages or manage_channel, are unaffected.