Skip to content

Commit

Permalink
add Member#IsTimedOut
Browse files Browse the repository at this point in the history
  • Loading branch information
caneleex committed Dec 22, 2021
1 parent 96229f3 commit e1163cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package core

import (
"strings"
"time"

"github.com/DisgoOrg/disgo/discord"
"github.com/DisgoOrg/disgo/rest"
Expand Down Expand Up @@ -62,6 +63,11 @@ func (m *Member) IsOwner() bool {
return false
}

// IsTimedOut returns whether this Member is timed out
func (m *Member) IsTimedOut() bool {
return m.CommunicationDisabledUntil != nil && m.CommunicationDisabledUntil.After(time.Now())
}

// AvatarURL returns the Avatar URL of the Member for this guild
func (m *Member) AvatarURL(size int) *string {
if m.Avatar == nil {
Expand Down

0 comments on commit e1163cd

Please sign in to comment.