mirror of
https://github.com/HMCore/Orbot.git
synced 2025-12-10 12:56:15 +00:00
hotfix 1
This commit is contained in:
@@ -76,7 +76,7 @@ object Admin {
|
||||
embed {
|
||||
title = "Now watching for new Hytale Blogposts every ${updateMs / 1000}s"
|
||||
description = """
|
||||
${Channels.getServerNames().joinToString("\n")}
|
||||
${Channels.getServerNames()?.joinToString("\n")}
|
||||
|
||||
**_Service Channels_**
|
||||
${Channels.getServiceChannelServers().joinToString("\n")}
|
||||
|
||||
@@ -123,13 +123,9 @@ object Channels {
|
||||
fun refreshServiceChannelsFromDisk() =
|
||||
Json.decodeFromString<List<ServiceChannel>>(SERVICE_CHANNELS_FILE.readText()).toMutableList()
|
||||
|
||||
fun getServerNames(server: Long? = null) = Main.jdas.flatMap { jda ->
|
||||
channels.filter { server == null || (jda.getTextChannelById(it.id)?.guild?.idLong == server) }.map {
|
||||
val channel = jda.getTextChannelById(it.id)
|
||||
if (channel == null) {
|
||||
Admin.warning("Channel ${it.id} is no longer active!")
|
||||
return@map "**${it.id}** *(inactive)*"
|
||||
}
|
||||
fun getServerNames(server: Long? = null): List<String>? = Main.jdas.flatMap { jda ->
|
||||
channels.filter { server == null || (jda.getTextChannelById(it.id)?.guild?.idLong == server) }.mapNotNull {
|
||||
val channel = jda.getTextChannelById(it.id) ?: return@mapNotNull null
|
||||
|
||||
val role = when (it.mentionedRole) {
|
||||
null -> ""
|
||||
|
||||
@@ -202,7 +202,7 @@ class OwnerCli : ListenerAdapter() {
|
||||
.setTitle("Server overview")
|
||||
.setColor(Color.GREEN)
|
||||
.setDescription("""
|
||||
${Channels.getServerNames(event.message.guild.idLong).joinToString("\n")}
|
||||
${Channels.getServerNames(event.message.guild.idLong)?.joinToString("\n")}
|
||||
|
||||
**_Service Channels_**
|
||||
${Channels.getServiceChannelServers(event.message.guild.idLong).joinToString("\n")}
|
||||
|
||||
Reference in New Issue
Block a user