Skip to content

Commit

Permalink
fix: discord channel config
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Sep 24, 2024
1 parent 13c7d06 commit 5a2282e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import jakarta.validation.Valid
import jakarta.validation.constraints.NotBlank
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
Expand All @@ -20,7 +19,6 @@ class DiscordWebhookClientConfig {
private val logger = KotlinLogging.logger { }

@Bean
@ConditionalOnProperty(prefix = "client.discord.webhook", name = ["url"])
@ConfigurationProperties(prefix = "client.discord.webhook")
fun discordWebhookConfig() = Config()

Expand All @@ -32,13 +30,12 @@ class DiscordWebhookClientConfig {
): DiscordWebhookClient {
logger.info { "initialized DiscordWebhookClient. $discordWebhookConfig" }

val webclient = WebClientFactory.generate(discordWebhookConfig.url)
val webclient = WebClientFactory.generate("https://discord.com/api/webhooks")

return SuspendableDiscordWebhookClient(webclient, discordWebhookConfig.channels)
}

data class Config(
val url: String = "https://discord.com/api/webhooks",
var channels: Map<Channel, Token> = emptyMap()
) {
data class Token(
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ client:
unlink-path: /v1/user/unlink
discord:
webhook:
url: https://discord.com/api/webhooks
channels:
STATISTICS:
token:
Expand Down

0 comments on commit 5a2282e

Please sign in to comment.