mirror of
https://github.com/HMCore/Orbot.git
synced 2025-12-11 05:16:18 +00:00
@@ -123,9 +123,13 @@ object Channels {
|
|||||||
fun refreshServiceChannelsFromDisk() =
|
fun refreshServiceChannelsFromDisk() =
|
||||||
Json.decodeFromString<List<ServiceChannel>>(SERVICE_CHANNELS_FILE.readText()).toMutableList()
|
Json.decodeFromString<List<ServiceChannel>>(SERVICE_CHANNELS_FILE.readText()).toMutableList()
|
||||||
|
|
||||||
fun getServerNames(server: Long? = null): List<String>? = Main.jdas.flatMap { jda ->
|
fun getServerNames(server: Long? = null) = Main.jdas.flatMap { jda ->
|
||||||
channels.filter { server == null || (jda.getTextChannelById(it.id)?.guild?.idLong == server) }.mapNotNull {
|
channels.filter { server == null || (jda.getTextChannelById(it.id)?.guild?.idLong == server) }.map {
|
||||||
val channel = jda.getTextChannelById(it.id) ?: return@mapNotNull null
|
val channel = jda.getTextChannelById(it.id)
|
||||||
|
if (channel == null) {
|
||||||
|
Admin.warning("Channel ${it.id} is no longer active!")
|
||||||
|
return@map "**${it.id}** *(inactive)*"
|
||||||
|
}
|
||||||
|
|
||||||
val role = when (it.mentionedRole) {
|
val role = when (it.mentionedRole) {
|
||||||
null -> ""
|
null -> ""
|
||||||
|
|||||||
Reference in New Issue
Block a user