1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-27 09:12:53 +00:00

discord: Add timeouts (#299)

This commit is contained in:
starshines 2021-12-21 00:56:11 +01:00 committed by GitHub
parent c2382028df
commit bc8a2b0cae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 5 deletions

View file

@ -168,6 +168,11 @@ type ModifyMemberData struct {
// Requires MOVE_MEMBER
VoiceChannel discord.ChannelID `json:"channel_id,omitempty"`
// CommunicationDisabledUntil specifies when the user's timeout will expire.
//
// Requires MODERATE_MEMBERS
CommunicationDisabledUntil *discord.Timestamp `json:"communication_disabled_until,omitempty"`
AuditLogReason `json:"-"`
}

View file

@ -335,6 +335,8 @@ type Member struct {
Joined Timestamp `json:"joined_at"`
// BoostedSince specifies when the user started boosting the guild.
BoostedSince Timestamp `json:"premium_since,omitempty"`
// CommunicationDisabledUntil specifies when the user's timeout will expire.
CommunicationDisabledUntil Timestamp `json:"communication_disabled_until"`
// Deaf specifies whether the user is deafened in voice channels.
Deaf bool `json:"deaf"`

View file

@ -88,6 +88,8 @@ const (
// Allows for launching activities (applications with the EMBEDDED flag)
// in a voice channel
PermissionStartEmbeddedActivities
// Allows for timing out users
PermissionModerateMembers
PermissionAllText = 0 |
PermissionViewChannel |

View file

@ -299,11 +299,12 @@ type GuildMemberRemoveEvent struct {
//
// https://discord.com/developers/docs/topics/gateway#guilds
type GuildMemberUpdateEvent struct {
GuildID discord.GuildID `json:"guild_id"`
RoleIDs []discord.RoleID `json:"roles"`
User discord.User `json:"user"`
Nick string `json:"nick"`
Avatar discord.Hash `json:"avatar"`
GuildID discord.GuildID `json:"guild_id"`
RoleIDs []discord.RoleID `json:"roles"`
User discord.User `json:"user"`
Nick string `json:"nick"`
Avatar discord.Hash `json:"avatar"`
CommunicationDisabledUntil discord.Timestamp `json:"communication_disabled_until"`
}
// UpdateMember updates the given discord.Member.