mirror of
https://github.com/HMCore/Orbot.git
synced 2025-12-11 05:16:18 +00:00
hotfix 1
This commit is contained in:
@@ -76,7 +76,7 @@ object Admin {
|
|||||||
embed {
|
embed {
|
||||||
title = "Now watching for new Hytale Blogposts every ${updateMs / 1000}s"
|
title = "Now watching for new Hytale Blogposts every ${updateMs / 1000}s"
|
||||||
description = """
|
description = """
|
||||||
${Channels.getServerNames().joinToString("\n")}
|
${Channels.getServerNames()?.joinToString("\n")}
|
||||||
|
|
||||||
**_Service Channels_**
|
**_Service Channels_**
|
||||||
${Channels.getServiceChannelServers().joinToString("\n")}
|
${Channels.getServiceChannelServers().joinToString("\n")}
|
||||||
|
|||||||
@@ -123,13 +123,9 @@ 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) = Main.jdas.flatMap { jda ->
|
fun getServerNames(server: Long? = null): List<String>? = Main.jdas.flatMap { jda ->
|
||||||
channels.filter { server == null || (jda.getTextChannelById(it.id)?.guild?.idLong == server) }.map {
|
channels.filter { server == null || (jda.getTextChannelById(it.id)?.guild?.idLong == server) }.mapNotNull {
|
||||||
val channel = jda.getTextChannelById(it.id)
|
val channel = jda.getTextChannelById(it.id) ?: return@mapNotNull null
|
||||||
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 -> ""
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ class OwnerCli : ListenerAdapter() {
|
|||||||
.setTitle("Server overview")
|
.setTitle("Server overview")
|
||||||
.setColor(Color.GREEN)
|
.setColor(Color.GREEN)
|
||||||
.setDescription("""
|
.setDescription("""
|
||||||
${Channels.getServerNames(event.message.guild.idLong).joinToString("\n")}
|
${Channels.getServerNames(event.message.guild.idLong)?.joinToString("\n")}
|
||||||
|
|
||||||
**_Service Channels_**
|
**_Service Channels_**
|
||||||
${Channels.getServiceChannelServers(event.message.guild.idLong).joinToString("\n")}
|
${Channels.getServiceChannelServers(event.message.guild.idLong).joinToString("\n")}
|
||||||
|
|||||||
Reference in New Issue
Block a user