Skip to content

Commit

Permalink
Fix announcement filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaFox161 committed Mar 8, 2024
1 parent 1ad42e3 commit dd3216f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ class AnnouncementService(
return announcements
}

suspend fun getAllAnnouncements(guildId: Snowflake, type: Announcement.Type? = null, returnDisabled: Boolean? = true): List<Announcement> {
return getAllAnnouncements(guildId).filter {
type?.equals(it.type) ?: true
}.filter { returnDisabled?.equals(true) ?: it.enabled }
suspend fun getAllAnnouncements(guildId: Snowflake, type: Announcement.Type? = null, returnDisabled: Boolean = true): List<Announcement> {
return getAllAnnouncements(guildId)
.filter { if (type == null) true else it.type == type }
.filter { if (returnDisabled) true else it.enabled }
}

suspend fun getAnnouncement(guildId: Snowflake, id: String): Announcement? {
Expand Down

0 comments on commit dd3216f

Please sign in to comment.