Skip to content

Commit

Permalink
Update kord.extensions to v1.6.0 (#110)
Browse files Browse the repository at this point in the history
* Update kord.extensions to v1.6.0

* Migrate to Kord Extensions 1.6.0

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Russell Banks <[email protected]>
  • Loading branch information
renovate[bot] and russellbanks committed Dec 11, 2023
1 parent c28e6bd commit 631b5ba
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kord-extensions = "1.5.7-20230506.104616-11"
kord-extensions = "1.6.0"
kordx-emoji = "0.5.0"
kotlin = "1.9.21"
kotlinx-coroutines = "1.7.3"
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.kotlindiscord.kord.extensions.checks.isNotBot
import data.Dao
import dev.kord.gateway.Intent
import dev.kord.gateway.Intents
import dev.kord.gateway.NON_PRIVILEGED
import dev.kord.gateway.PrivilegedIntent
import extensions.ConfigureExtension
import extensions.joinleaveupdate.CreateChannelExtension
Expand All @@ -37,7 +38,7 @@ suspend fun main() {
Dao.setupCache()
ExtensibleBot(EnvironmentVariables.discordApiKey) {
intents {
+Intents.nonPrivileged
+Intents.NON_PRIVILEGED
+Intent.Guilds
+Intent.GuildVoiceStates
+Intent.GuildMembers
Expand Down
10 changes: 4 additions & 6 deletions src/main/kotlin/extensions/ConfigureExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ import com.kotlindiscord.kord.extensions.components.publicButton
import com.kotlindiscord.kord.extensions.components.types.emoji
import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand
import com.kotlindiscord.kord.extensions.types.edit
import com.kotlindiscord.kord.extensions.types.respond
import data.Dao
import dev.kord.common.Color
import dev.kord.common.entity.ButtonStyle
import dev.kord.common.entity.ChannelType
import dev.kord.common.entity.Permission
import dev.kord.core.behavior.GuildBehavior
import dev.kord.rest.builder.message.create.embed
import dev.kord.rest.builder.message.modify.embed
import dev.kord.rest.builder.message.EmbedBuilder
import dev.kord.rest.builder.message.embed
import dev.kord.x.emoji.Emojis
import extensions.voicestateupdate.Action

Expand All @@ -64,7 +62,7 @@ class ConfigureExtension: Extension() {
action {
guild?.let { guild ->
respond {
embed {
embed(fun EmbedBuilder.() {
author {
name = "${guild.asGuild().name} configuration"
icon = guild.asGuild().icon?.cdnUrl?.toUrl()
Expand All @@ -83,7 +81,7 @@ class ConfigureExtension: Extension() {
}
)
}
}
})
components {
if (member != null) {
for (action in Action.entries) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class VoiceStateExtension: Extension() {
guildPrefs.channelId?.let(::Snowflake)?.let { snowflake ->
MessageChannelBehavior(snowflake, kord).createEmbed {
color = Color(EnvironmentVariables.accentColor()[0], EnvironmentVariables.accentColor()[1], EnvironmentVariables.accentColor()[2])
title = "${member.displayName} ${action?.phrase} ${channel?.asChannel()?.name}"
title = "${member.username} ${action?.phrase} ${channel?.asChannel()?.name}"
timestamp = Clock.System.now()
author {
name = member.displayName
name = member.username
icon = member.avatar?.cdnUrl?.toUrl()
}
footer {
Expand Down

0 comments on commit 631b5ba

Please sign in to comment.