mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Add function to check if a comment is marked as spoiler
This commit is contained in:
parent
a283ba7247
commit
28070bd32d
1 changed files with 10 additions and 0 deletions
10
comment.go
10
comment.go
|
|
@ -71,6 +71,16 @@ func (c *Comment) Delete() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// IsSpoiler returns if the comment is marked as spoiler or not.
|
||||
func (c *Comment) IsSpoiler() bool {
|
||||
for _, flag := range c.Flags {
|
||||
if flag == "spoiler" {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// MarkAsSpoiler marks the current comment as spoiler. Works only if the user has written the comment,
|
||||
// and it isn't already marked as spoiler.
|
||||
func (c *Comment) MarkAsSpoiler() error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue