Skip to content

Commit

Permalink
Remove unused getChatChannel command
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-korsa committed Jan 28, 2022
1 parent a98541b commit 9b26bb6
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/main/kotlin/com/dominikkorsa/discordintegration/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import discord4j.common.util.Snowflake
import discord4j.core.DiscordClient
import discord4j.core.GatewayDiscordClient
import discord4j.core.`object`.entity.Webhook
import discord4j.core.`object`.entity.channel.TextChannel
import discord4j.core.`object`.presence.ClientActivity
import discord4j.core.`object`.presence.ClientPresence
import discord4j.core.`object`.presence.Status
Expand Down Expand Up @@ -71,18 +70,6 @@ class Client(private val plugin: DiscordIntegration) {
}
}

private suspend fun getChatChannel(id: Snowflake): TextChannel {
val channel = gateway
?.getChannelById(id)
?.awaitFirstOrNull() ?: throw Exception("Channel not found")
if (channel !is TextChannel) throw Exception("Channel is not of type Text")
return channel
}

private suspend fun getChatChannel(id: String): TextChannel {
return getChatChannel(Snowflake.of(id))
}

private suspend fun getWebhooks(): Collection<Webhook>? {
return gateway?.let { gateway ->
plugin.configManager.chatWebhooks
Expand Down

0 comments on commit 9b26bb6

Please sign in to comment.