Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kord.extensions to v1.6.0 #110

Merged
merged 2 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.20"
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