Skip to content

Commit

Permalink
Disable pings in webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-korsa committed Jul 26, 2021
1 parent 07e388f commit 6d502c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/kotlin/com/dominikkorsa/discordintegration/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import discord4j.core.event.domain.message.MessageCreateEvent
import discord4j.core.spec.MessageCreateSpec
import discord4j.discordjson.json.ImmutableActivityUpdateRequest
import discord4j.discordjson.json.gateway.ImmutableStatusUpdate
import discord4j.rest.util.AllowedMentions
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.filterNot
Expand All @@ -18,6 +19,10 @@ import kotlinx.coroutines.reactive.awaitFirstOrNull
import org.bukkit.Bukkit

class Client(private val plugin: DiscordIntegration) {
companion object {
private val allowedMentionsNone = AllowedMentions.builder().build()
}

private var gateway: GatewayDiscordClient? = null
private val tpsService = TpsService()

Expand Down Expand Up @@ -126,6 +131,7 @@ class Client(private val plugin: DiscordIntegration) {
spec.setUsername(playerName)
spec.setAvatarUrl(avatarUrl)
spec.setContent(content)
spec.setAllowedMentions(allowedMentionsNone)
}.awaitFirstOrNull()
}
}
Expand Down

0 comments on commit 6d502c1

Please sign in to comment.