package nl.voidcorp.dbot.storage import net.dv8tion.jda.core.entities.Guild import net.dv8tion.jda.core.entities.Role import nl.voidcorp.dbot.commands.GSM import java.time.LocalDateTime data class GuildSettings( val prefixes: MutableList = mutableListOf(), val muted: MutableMap> = mutableMapOf() ) { fun getPrefixes(): MutableCollection { return prefixes } val primaryPrefix: String get() = prefixes.firstOrNull() ?: "!" } fun Guild.settings(): GuildSettings { return GSM.getSettings(this) } data class MuteInfo(val member: Long, val roles: List) fun Map.getBefore(test: LocalDateTime = LocalDateTime.now()): List = this.filter { it.key.isBefore(test) }.map { it.value } fun MutableMap>.put(a: LocalDateTime, b: A) { if (this[a] == null) { this[a] = mutableListOf() } this[a]!! += b }