diff --git a/README.md b/README.md index 90fee8e..839d1d5 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ action { val member = user.asMember(guild!!.id) val roles = member.roles.toList().map { it.id } if (MODERATOR_ROLES.any { it in roles }) { - targetMessages.forEach { it.pin("Pinned by ${member.tagOrUsername()}") } + targetMessages.forEach { it.pin("Pinned by ${member.tag}") } edit { content = "Messages pinned." } return@action } @@ -120,7 +120,7 @@ action { respond { content = "**Error:** This is not your thread." } return@action } - targetMessages.forEach { it.pin("Pinned by ${member.tagOrUsername()}") } + targetMessages.forEach { it.pin("Pinned by ${member.tag}") } edit { content = "Messages pinned." } } ``` @@ -130,7 +130,7 @@ action { if (this.member?.asMemberOrNull()?.mayManageRole(arguments.role) == true) { arguments.targetUser.removeRole( arguments.role.id, - "${this.user.asUserOrNull()?.tagOrUsername() ?: this.user.id} used /team remove" + "${this.user.asUserOrNull()?.tag ?: this.user.id} used /team remove" ) respond { content = "Successfully removed ${arguments.targetUser.mention} from " + @@ -166,7 +166,7 @@ action { val roles = member.roles.toList().map { it.id } if (MODERATOR_ROLES.any { it in roles }) { - targetMessages.forEach { it.pin("Pinned by ${member.tagOrUsername()}") } + targetMessages.forEach { it.pin("Pinned by ${member.tag}") } edit { content = "Messages pinned." } return@action @@ -178,7 +178,7 @@ action { return@action } - targetMessages.forEach { it.pin("Pinned by ${member.tagOrUsername()}") } + targetMessages.forEach { it.pin("Pinned by ${member.tag}") } edit { content = "Messages pinned." } } @@ -190,7 +190,7 @@ action { arguments.targetUser.removeRole( arguments.role.id, - "${this.user.asUserOrNull()?.tagOrUsername() ?: this.user.id} used /team remove" + "${this.user.asUserOrNull()?.tag ?: this.user.id} used /team remove" ) respond { diff --git a/module-ama/src/main/kotlin/org/quiltmc/community/cozy/modules/ama/_Utils.kt b/module-ama/src/main/kotlin/org/quiltmc/community/cozy/modules/ama/_Utils.kt index 13829db..c06d689 100644 --- a/module-ama/src/main/kotlin/org/quiltmc/community/cozy/modules/ama/_Utils.kt +++ b/module-ama/src/main/kotlin/org/quiltmc/community/cozy/modules/ama/_Utils.kt @@ -15,7 +15,6 @@ import com.kotlindiscord.kord.extensions.components.ComponentContainer import com.kotlindiscord.kord.extensions.components.components import com.kotlindiscord.kord.extensions.components.ephemeralButton import com.kotlindiscord.kord.extensions.utils.loadModule -import com.kotlindiscord.kord.extensions.utils.tagOrUsername import dev.kord.common.Color import dev.kord.common.entity.ButtonStyle import dev.kord.common.entity.Snowflake @@ -49,7 +48,7 @@ public val User.uniqueName: String "@${this.username}" } else { // Still using name#discrim system - this.tagOrUsername() + this.tag } public fun EmbedBuilder.questionEmbed( @@ -383,7 +382,7 @@ public suspend inline fun ComponentContainer.answeringButtons( check { if (event.interaction.user != claimer) { - fail("You did not claim this question! ${claimer.tagOrUsername()} did") + fail("You did not claim this question! ${claimer.tag} did") } } @@ -407,7 +406,7 @@ public suspend inline fun ComponentContainer.answeringButtons( style = ButtonStyle.Success check { if (event.interaction.user != claimer) { - fail("You did not claim the question! ${claimer.tagOrUsername()} did") + fail("You did not claim the question! ${claimer.tag} did") } } diff --git a/module-moderation/src/main/kotlin/org/quiltmc/community/cozy/modules/moderation/ModerationExtension.kt b/module-moderation/src/main/kotlin/org/quiltmc/community/cozy/modules/moderation/ModerationExtension.kt index 65a62ea..99b2b51 100644 --- a/module-moderation/src/main/kotlin/org/quiltmc/community/cozy/modules/moderation/ModerationExtension.kt +++ b/module-moderation/src/main/kotlin/org/quiltmc/community/cozy/modules/moderation/ModerationExtension.kt @@ -163,7 +163,7 @@ public class ModerationExtension( if (arguments.duration != null) { arguments.user.timeout( arguments.duration!!, - reason = "Timed out by ${user.asUser().tagOrUsername()}: $reason" + reason = "Timed out by ${user.asUser().tag}: $reason" ) respond { @@ -171,7 +171,7 @@ public class ModerationExtension( } } else { arguments.user.removeTimeout( - reason = "Timeout removed by ${user.asUser().tagOrUsername()}: $reason" + reason = "Timeout removed by ${user.asUser().tag}: $reason" ) respond { @@ -281,7 +281,7 @@ public class ModerationExtension( if (arguments.duration != null) { arguments.user.timeout( arguments.duration!!, - reason = "Timed out by ${user?.asUser()?.tagOrUsername()}: $reason" + reason = "Timed out by ${user?.asUser()?.tag}: $reason" ) message.respond { @@ -289,7 +289,7 @@ public class ModerationExtension( } } else { arguments.user.removeTimeout( - reason = "Timeout removed by ${user?.asUser()?.tagOrUsername()}: $reason" + reason = "Timeout removed by ${user?.asUser()?.tag}: $reason" ) message.respond { diff --git a/module-user-cleanup/src/main/kotlin/org/quiltmc/community/cozy/modules/cleanup/UserCleanupExtension.kt b/module-user-cleanup/src/main/kotlin/org/quiltmc/community/cozy/modules/cleanup/UserCleanupExtension.kt index de30d01..10b624c 100644 --- a/module-user-cleanup/src/main/kotlin/org/quiltmc/community/cozy/modules/cleanup/UserCleanupExtension.kt +++ b/module-user-cleanup/src/main/kotlin/org/quiltmc/community/cozy/modules/cleanup/UserCleanupExtension.kt @@ -18,7 +18,6 @@ import com.kotlindiscord.kord.extensions.time.TimestampType import com.kotlindiscord.kord.extensions.time.toDiscord import com.kotlindiscord.kord.extensions.utils.scheduling.Scheduler import com.kotlindiscord.kord.extensions.utils.scheduling.Task -import com.kotlindiscord.kord.extensions.utils.tagOrUsername import dev.kord.core.behavior.channel.createMessage import dev.kord.core.entity.Guild import dev.kord.core.entity.Member @@ -106,7 +105,7 @@ public class UserCleanupExtension( description = "**Mention** | **Tag** | **Join date**\n\n" chunk.forEach { member -> - description += "${member.mention} | ${member.tagOrUsername()} |" + + description += "${member.mention} | ${member.tag} |" + "${member.joinedAt.toDiscord(TimestampType.Default)}\n" } } @@ -151,7 +150,7 @@ public class UserCleanupExtension( "| ------- | --- | --------------- |\n" + removed.joinToString("\n") { - "| ${it.id} | ${it.tagOrUsername()} | ${instantFormatter.format(it.joinedAt.toJavaInstant())} |" + "| ${it.id} | ${it.tag} | ${instantFormatter.format(it.joinedAt.toJavaInstant())} |" } config.getLoggingChannel(guild).createMessage { diff --git a/module-welcome/src/main/kotlin/org/quiltmc/community/cozy/modules/welcome/WelcomeExtension.kt b/module-welcome/src/main/kotlin/org/quiltmc/community/cozy/modules/welcome/WelcomeExtension.kt index 2777a8e..a223f23 100644 --- a/module-welcome/src/main/kotlin/org/quiltmc/community/cozy/modules/welcome/WelcomeExtension.kt +++ b/module-welcome/src/main/kotlin/org/quiltmc/community/cozy/modules/welcome/WelcomeExtension.kt @@ -15,7 +15,6 @@ import com.kotlindiscord.kord.extensions.commands.converters.impl.string import com.kotlindiscord.kord.extensions.extensions.Extension import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand import com.kotlindiscord.kord.extensions.extensions.event -import com.kotlindiscord.kord.extensions.utils.tagOrUsername import dev.kord.common.entity.Snowflake import dev.kord.core.behavior.channel.asChannelOf import dev.kord.core.behavior.channel.asChannelOfOrNull @@ -142,7 +141,7 @@ public class WelcomeExtension : Extension() { name = "Staff Member" value = "${user.mention} (" + "`${user.id}` / " + - "`${user.asUser().tagOrUsername()}`" + + "`${user.asUser().tag}`" + ")" } } @@ -217,7 +216,7 @@ public class WelcomeExtension : Extension() { name = "Staff Member" value = "${user.mention} (" + "`${user.id}` / " + - "`${user.asUser().tagOrUsername()}`" + + "`${user.asUser().tag}`" + ")" } } @@ -286,7 +285,7 @@ public class WelcomeExtension : Extension() { name = "Staff Member" value = "${user.mention} (" + "`${user.id}` / " + - "`${user.asUser().tagOrUsername()}`" + + "`${user.asUser().tag}`" + ")" } } diff --git a/module-welcome/src/main/kotlin/org/quiltmc/community/cozy/modules/welcome/blocks/ComplianceBlock.kt b/module-welcome/src/main/kotlin/org/quiltmc/community/cozy/modules/welcome/blocks/ComplianceBlock.kt index b89a1aa..192828d 100644 --- a/module-welcome/src/main/kotlin/org/quiltmc/community/cozy/modules/welcome/blocks/ComplianceBlock.kt +++ b/module-welcome/src/main/kotlin/org/quiltmc/community/cozy/modules/welcome/blocks/ComplianceBlock.kt @@ -10,7 +10,6 @@ package org.quiltmc.community.cozy.modules.welcome.blocks import com.kotlindiscord.kord.extensions.DISCORD_BLURPLE import com.kotlindiscord.kord.extensions.koin.KordExKoinComponent -import com.kotlindiscord.kord.extensions.utils.tagOrUsername import dev.kord.common.entity.ButtonStyle import dev.kord.common.entity.Snowflake import dev.kord.core.Kord @@ -134,7 +133,7 @@ public data class ComplianceBlock( inline = true name = "User" - value = "${user.mention} (`${user.tagOrUsername()}` / `${user.id}`)" + value = "${user.mention} (`${user.tag}` / `${user.id}`)" } } diff --git a/src/main/kotlin/org/quiltmc/community/_Utils.kt b/src/main/kotlin/org/quiltmc/community/_Utils.kt index ef38315..2e20614 100644 --- a/src/main/kotlin/org/quiltmc/community/_Utils.kt +++ b/src/main/kotlin/org/quiltmc/community/_Utils.kt @@ -214,7 +214,7 @@ suspend fun Guild.getFilterLogChannel(): GuildMessageChannel? { suspend fun EmbedBuilder.userField(user: UserBehavior, role: String? = null, inline: Boolean = false) { field { name = role ?: "User" - value = "${user.mention} (`${user.id}` / `${user.asUser().tagOrUsername()}`)" + value = "${user.mention} (`${user.id}` / `${user.asUser().tag}`)" this.inline = inline } diff --git a/src/main/kotlin/org/quiltmc/community/modes/collab/extensions/LookupExtension.kt b/src/main/kotlin/org/quiltmc/community/modes/collab/extensions/LookupExtension.kt index 80d0b28..0305b71 100644 --- a/src/main/kotlin/org/quiltmc/community/modes/collab/extensions/LookupExtension.kt +++ b/src/main/kotlin/org/quiltmc/community/modes/collab/extensions/LookupExtension.kt @@ -16,7 +16,6 @@ import com.kotlindiscord.kord.extensions.extensions.Extension import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand import com.kotlindiscord.kord.extensions.time.TimestampType import com.kotlindiscord.kord.extensions.time.toDiscord -import com.kotlindiscord.kord.extensions.utils.tagOrUsername import com.kotlindiscord.kord.extensions.utils.translate import dev.kord.common.entity.Snowflake import dev.kord.rest.Image @@ -75,7 +74,7 @@ class LookupExtension : Extension() { color = DISCORD_BLURPLE description = "**__Basic Information__**\n" + - "**Tag:** `${user.tagOrUsername()}`\n" + + "**Tag:** `${user.tag}`\n" + "**ID:** `${user.id.value}`\n" + "**Mention:** ${user.mention}\n\n" + @@ -97,7 +96,7 @@ class LookupExtension : Extension() { } author { - name = user.tagOrUsername() + name = user.tag icon = user.avatar?.cdnUrl?.toUrl() } @@ -269,7 +268,7 @@ class LookupExtension : Extension() { builder.append( "**__Inviter Information__**\n" + - "**Tag:** `${user.tagOrUsername()}`\n" + + "**Tag:** `${user.tag}`\n" + "**ID:** `${user.id.value}`\n" + "**Mention:** ${user.mention}\n\n" + diff --git a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/ApplicationsExtension.kt b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/ApplicationsExtension.kt index 491a654..b0c01e5 100644 --- a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/ApplicationsExtension.kt +++ b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/ApplicationsExtension.kt @@ -133,13 +133,13 @@ class ApplicationsExtension : Extension() { field { inline = true name = "Moderator" - value = "${user.asUser().tagOrUsername()} (${user.mention})" + value = "${user.asUser().tag} (${user.mention})" } field { inline = true name = "User" - value = "${member.tagOrUsername()} (${member.mention})" + value = "${member.tag} (${member.mention})" } } @@ -330,13 +330,13 @@ class ApplicationsExtension : Extension() { field { inline = true name = "Moderator" - value = "${user!!.asUser().tagOrUsername()} (${user!!.mention})" + value = "${user!!.asUser().tag} (${user!!.mention})" } field { inline = true name = "User" - value = "${member.tagOrUsername()} (${member.mention})" + value = "${member.tag} (${member.mention})" } } @@ -431,7 +431,7 @@ class ApplicationsExtension : Extension() { // Not actually deprecated, Kord walled themselves into a hole here @Suppress("DEPRECATION_ERROR") - val thread = threadChannel.startPrivateThread("App: ${user.tagOrUsername()}") + val thread = threadChannel.startPrivateThread("App: ${user.tag}") val initialMessage = thread.createMessage("Better get the mods in...") initialMessage.edit { content = settings.moderatorRoles.joinToString { "<@&$it>" } } @@ -439,7 +439,7 @@ class ApplicationsExtension : Extension() { initialMessage.edit { content = buildString { - appendLine("**Application thread for ${user.tagOrUsername()}**") + appendLine("**Application thread for ${user.tag}**") append("User ID below.") } } @@ -503,13 +503,13 @@ class ApplicationsExtension : Extension() { field { inline = true name = "Moderator" - value = "${event.interaction.user.tagOrUsername()} (${event.interaction.user.mention})" + value = "${event.interaction.user.tag} (${event.interaction.user.mention})" } field { inline = true name = "User" - value = "${member.tagOrUsername()} (${member.mention})" + value = "${member.tag} (${member.mention})" } } @@ -786,7 +786,7 @@ class ApplicationsExtension : Extension() { title = "Application (${event.request.status.name.capitalizeWords()})" description = buildString { - appendLine("**User:** ${user.tagOrUsername()}") + appendLine("**User:** ${user.tag}") appendLine("**Mention:** ${user.mention}") appendLine( "**Created:** ${user.id.timestamp.longAndRelative}" diff --git a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/ShowcaseExtension.kt b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/ShowcaseExtension.kt index 0010158..230413d 100644 --- a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/ShowcaseExtension.kt +++ b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/ShowcaseExtension.kt @@ -27,7 +27,6 @@ import com.kotlindiscord.kord.extensions.storage.StorageUnit import com.kotlindiscord.kord.extensions.utils.authorId import com.kotlindiscord.kord.extensions.utils.capitalizeWords import com.kotlindiscord.kord.extensions.utils.dm -import com.kotlindiscord.kord.extensions.utils.tagOrUsername import dev.kord.common.entity.ChannelType import dev.kord.common.entity.MessageType import dev.kord.common.entity.Permission @@ -122,7 +121,7 @@ class ShowcaseExtension : Extension() { val thread = channel.startPublicThreadWithMessage( event.message.id, title - ) { reason = "Showcase thread created for ${event.message.author?.tagOrUsername()}" } + ) { reason = "Showcase thread created for ${event.message.author?.tag}" } threads.set( OwnedThread(thread.id, authorId, guild.id) diff --git a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/SubteamsExtension.kt b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/SubteamsExtension.kt index 8aa7c8a..5ae9d3c 100644 --- a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/SubteamsExtension.kt +++ b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/SubteamsExtension.kt @@ -14,7 +14,6 @@ import com.kotlindiscord.kord.extensions.commands.converters.impl.member import com.kotlindiscord.kord.extensions.commands.converters.impl.role import com.kotlindiscord.kord.extensions.extensions.Extension import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand -import com.kotlindiscord.kord.extensions.utils.tagOrUsername import dev.kord.common.entity.Permission import dev.kord.core.entity.Member import dev.kord.core.entity.Role @@ -43,7 +42,7 @@ class SubteamsExtension : Extension() { if (this.member?.asMemberOrNull()?.mayManageRole(arguments.role) == true) { arguments.targetUser.addRole( arguments.role.id, - "${this.user.asUserOrNull()?.tagOrUsername() ?: this.user.id} used /team add" + "${this.user.asUserOrNull()?.tag ?: this.user.id} used /team add" ) respond { @@ -70,7 +69,7 @@ class SubteamsExtension : Extension() { if (this.member?.asMemberOrNull()?.mayManageRole(arguments.role) == true) { arguments.targetUser.removeRole( arguments.role.id, - "${this.user.asUserOrNull()?.tagOrUsername() ?: this.user.id} used /team remove" + "${this.user.asUserOrNull()?.tag ?: this.user.id} used /team remove" ) respond { content = "Successfully removed ${arguments.targetUser.mention} from " + diff --git a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/UtilityExtension.kt b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/UtilityExtension.kt index e21c4cf..1b0a96d 100644 --- a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/UtilityExtension.kt +++ b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/UtilityExtension.kt @@ -206,7 +206,7 @@ class UtilityExtension : Extension() { action { val owner = event.channel.owner.asUser() - logger.info { "Thread created by ${owner.tagOrUsername()}" } + logger.info { "Thread created by ${owner.tag}" } val role = when (event.channel.guildId) { COMMUNITY_GUILD -> event.channel.guild.getRole(COMMUNITY_MODERATOR_ROLE) @@ -446,7 +446,7 @@ class UtilityExtension : Extension() { val roles = member.roles.toList().map { it.id } if (privilegedRoles.any { it in roles }) { - targetMessages.forEach { it.pin("Pinned by ${member.tagOrUsername()}") } + targetMessages.forEach { it.pin("Pinned by ${member.tag}") } edit { content = "Messages pinned." } return@action @@ -458,7 +458,7 @@ class UtilityExtension : Extension() { return@action } - targetMessages.forEach { it.pin("Pinned by ${member.tagOrUsername()}") } + targetMessages.forEach { it.pin("Pinned by ${member.tag}") } edit { content = "Messages pinned." } } @@ -479,7 +479,7 @@ class UtilityExtension : Extension() { val roles = member.roles.toList().map { it.id } if (privilegedRoles.any { it in roles }) { - targetMessages.forEach { it.unpin("Unpinned by ${member.tagOrUsername()}") } + targetMessages.forEach { it.unpin("Unpinned by ${member.tag}") } edit { content = "Messages unpinned." } return@action @@ -491,7 +491,7 @@ class UtilityExtension : Extension() { return@action } - targetMessages.forEach { it.unpin("Unpinned by ${member.tagOrUsername()}") } + targetMessages.forEach { it.unpin("Unpinned by ${member.tag}") } edit { content = "Messages unpinned." } } @@ -557,7 +557,7 @@ class UtilityExtension : Extension() { ) if (msg.content.isNotEmpty() || msg.attachments.isNotEmpty()) { - val authorName = author?.tagOrUsername() ?: msg.data.author.username + val authorName = author?.tag ?: msg.data.author.username this@UtilityExtension.logger.debug { "\nAuthor name: `$authorName`\n${msg.content}\n" } @@ -600,7 +600,7 @@ class UtilityExtension : Extension() { ) if (msg.content.isNotEmpty() || msg.attachments.isNotEmpty()) { - val authorName = author?.tagOrUsername() ?: msg.data.author.username + val authorName = author?.tag ?: msg.data.author.username if (msg.type == MessageType.ChatInputCommand) { builder.append("🖥️ ") @@ -660,7 +660,7 @@ class UtilityExtension : Extension() { channel.edit { name = arguments.name - reason = "Renamed by ${member.tagOrUsername()}" + reason = "Renamed by ${member.tag}" } edit { content = "Thread renamed." } @@ -677,7 +677,7 @@ class UtilityExtension : Extension() { channel.edit { name = arguments.name - reason = "Renamed by ${member.tagOrUsername()}" + reason = "Renamed by ${member.tag}" } edit { content = "Thread renamed." } @@ -706,7 +706,7 @@ class UtilityExtension : Extension() { this.archived = true this.locked = arguments.lock - reason = "Archived by ${user.asUser().tagOrUsername()}" + reason = "Archived by ${user.asUser().tag}" } edit { @@ -751,7 +751,7 @@ class UtilityExtension : Extension() { channel.edit { archived = true - reason = "Archived by ${user.asUser().tagOrUsername()}" + reason = "Archived by ${user.asUser().tag}" } edit { content = "Thread archived." } @@ -778,7 +778,7 @@ class UtilityExtension : Extension() { } if (privilegedRoles.any { it in roles }) { - arguments.message.pin("Pinned by ${member.tagOrUsername()}") + arguments.message.pin("Pinned by ${member.tag}") edit { content = "Message pinned." } return@action @@ -790,7 +790,7 @@ class UtilityExtension : Extension() { return@action } - arguments.message.pin("Pinned by ${member.tagOrUsername()}") + arguments.message.pin("Pinned by ${member.tag}") edit { content = "Message pinned." } } @@ -816,7 +816,7 @@ class UtilityExtension : Extension() { } if (privilegedRoles.any { it in roles }) { - arguments.message.unpin("Unpinned by ${member.tagOrUsername()}") + arguments.message.unpin("Unpinned by ${member.tag}") edit { content = "Message unpinned." } return@action @@ -828,7 +828,7 @@ class UtilityExtension : Extension() { return@action } - arguments.message.unpin("Unpinned by ${member.tagOrUsername()}") + arguments.message.unpin("Unpinned by ${member.tag}") edit { content = "Message unpinned." } } @@ -850,7 +850,7 @@ class UtilityExtension : Extension() { if (channel.isArchived) { channel.edit { archived = false - reason = "`/thread prevent-archiving` run by ${member.tagOrUsername()}" + reason = "`/thread prevent-archiving` run by ${member.tag}" } } @@ -1087,7 +1087,7 @@ class UtilityExtension : Extension() { .filter { allowedPerms?.contains(it) == true } .forEach { allowed += it } - reason = "Mute role permissions update triggered by ${user.asUser().tagOrUsername()}" + reason = "Mute role permissions update triggered by ${user.asUser().tag}" } channelsUpdated += 1 @@ -1106,7 +1106,7 @@ class UtilityExtension : Extension() { role.edit { permissions = Permissions() - reason = "Mute role permissions update triggered by ${user.asUser().tagOrUsername()}" + reason = "Mute role permissions update triggered by ${user.asUser().tag}" } respond { content = "Mute role permissions cleared." } @@ -1176,7 +1176,7 @@ class UtilityExtension : Extension() { .minus(Permission.SendMessages) .minus(Permission.SendMessagesInThreads) - reason = "Server locked down by ${user.asUser().tagOrUsername()}" + reason = "Server locked down by ${user.asUser().tag}" } moderatorRole.edit { @@ -1187,7 +1187,7 @@ class UtilityExtension : Extension() { .plus(Permission.SendMessages) .plus(Permission.SendMessagesInThreads) - reason = "Server locked down by ${user.asUser().tagOrUsername()}" + reason = "Server locked down by ${user.asUser().tag}" } guild?.asGuildOrNull()?.getModLogChannel()?.createEmbed { @@ -1233,7 +1233,7 @@ class UtilityExtension : Extension() { .plus(Permission.SendMessages) .plus(Permission.SendMessagesInThreads) - reason = "Server unlocked by ${user.asUser().tagOrUsername()}" + reason = "Server unlocked by ${user.asUser().tag}" } moderatorRole.edit { @@ -1244,7 +1244,7 @@ class UtilityExtension : Extension() { .minus(Permission.SendMessages) .minus(Permission.SendMessagesInThreads) - reason = "Server unlocked by ${user.asUser().tagOrUsername()}" + reason = "Server unlocked by ${user.asUser().tag}" } guild?.asGuildOrNull()?.getModLogChannel()?.createEmbed { @@ -1309,14 +1309,14 @@ class UtilityExtension : Extension() { ch.editRolePermission(staffRoleId) { SPEAKING_PERMISSIONS.forEach { allowed += it } - reason = "Channel locked by ${user.asUser().tagOrUsername()}" + reason = "Channel locked by ${user.asUser().tag}" } } ch.editRolePermission(guild!!.id) { SPEAKING_PERMISSIONS.forEach { denied += it } - reason = "Channel locked by ${user.asUser().tagOrUsername()}" + reason = "Channel locked by ${user.asUser().tag}" } ch.createMessage { @@ -1374,7 +1374,7 @@ class UtilityExtension : Extension() { val ch = channelObj as TextChannel ch.getPermissionOverwritesForRole(guild!!.id) - ?.delete("Channel unlocked by ${user.asUser().tagOrUsername()}") + ?.delete("Channel unlocked by ${user.asUser().tag}") ch.createMessage { content = "Channel unlocked by a moderator." @@ -1508,7 +1508,7 @@ class UtilityExtension : Extension() { .minus(Permission.SendMessages) .minus(Permission.SendMessagesInThreads) - reason = "Server locked down by ${user?.asUser()?.tagOrUsername()}" + reason = "Server locked down by ${user?.asUser()?.tag}" } moderatorRole.edit { @@ -1519,7 +1519,7 @@ class UtilityExtension : Extension() { .plus(Permission.SendMessages) .plus(Permission.SendMessagesInThreads) - reason = "Server locked down by ${user?.asUser()?.tagOrUsername()}" + reason = "Server locked down by ${user?.asUser()?.tag}" } guild?.asGuildOrNull()?.getModLogChannel()?.createEmbed { @@ -1562,7 +1562,7 @@ class UtilityExtension : Extension() { .plus(Permission.SendMessages) .plus(Permission.SendMessagesInThreads) - reason = "Server unlocked by ${user?.asUser()?.tagOrUsername()}" + reason = "Server unlocked by ${user?.asUser()?.tag}" } moderatorRole.edit { @@ -1573,7 +1573,7 @@ class UtilityExtension : Extension() { .minus(Permission.SendMessages) .minus(Permission.SendMessagesInThreads) - reason = "Server unlocked by ${user?.asUser()?.tagOrUsername()}" + reason = "Server unlocked by ${user?.asUser()?.tag}" } guild?.asGuildOrNull()?.getModLogChannel()?.createEmbed { @@ -1635,14 +1635,14 @@ class UtilityExtension : Extension() { ch.editRolePermission(staffRoleId) { SPEAKING_PERMISSIONS.forEach { allowed += it } - reason = "Channel locked by ${user?.asUser()?.tagOrUsername()}" + reason = "Channel locked by ${user?.asUser()?.tag}" } } ch.editRolePermission(guild!!.id) { SPEAKING_PERMISSIONS.forEach { denied += it } - reason = "Channel locked by ${user?.asUser()?.tagOrUsername()}" + reason = "Channel locked by ${user?.asUser()?.tag}" } ch.createMessage { @@ -1697,7 +1697,7 @@ class UtilityExtension : Extension() { val ch = channelObj as TextChannel ch.getPermissionOverwritesForRole(guild!!.id) - ?.delete("Channel unlocked by ${user?.asUser()?.tagOrUsername()}") + ?.delete("Channel unlocked by ${user?.asUser()?.tag}") ch.createMessage { content = "Channel unlocked by a moderator." diff --git a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/filtering/FilterExtension.kt b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/filtering/FilterExtension.kt index ecff85b..471c5f7 100644 --- a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/filtering/FilterExtension.kt +++ b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/filtering/FilterExtension.kt @@ -198,7 +198,7 @@ class FilterExtension : Extension() { field { name = "Moderator" - value = "${user.mention} (`${user.id.value}` / `${user.asUser().tagOrUsername()}`)" + value = "${user.mention} (`${user.id.value}` / `${user.asUser().tag}`)" } } @@ -242,7 +242,7 @@ class FilterExtension : Extension() { field { name = "Moderator" - value = "${user.mention} (`${user.id.value}` / `${user.asUser().tagOrUsername()}`)" + value = "${user.mention} (`${user.id.value}` / `${user.asUser().tag}`)" } } @@ -305,7 +305,7 @@ class FilterExtension : Extension() { field { name = "Moderator" - value = "${user.mention} (`${user.id.value}` / `${user.asUser().tagOrUsername()}`)" + value = "${user.mention} (`${user.id.value}` / `${user.asUser().tag}`)" } } @@ -358,7 +358,7 @@ class FilterExtension : Extension() { field { name = "Moderator" - value = "${user.mention} (`${user.id.value}` / `${user.asUser().tagOrUsername()}`)" + value = "${user.mention} (`${user.id.value}` / `${user.asUser().tag}`)" } } @@ -402,7 +402,7 @@ class FilterExtension : Extension() { field { name = "Moderator" - value = "${user.mention} (`${user.id.value}` / `${user.asUser().tagOrUsername()}`)" + value = "${user.mention} (`${user.id.value}` / `${user.asUser().tag}`)" } } @@ -455,7 +455,7 @@ class FilterExtension : Extension() { field { name = "Moderator" - value = "${user.mention} (`${user.id.value}` / `${user.asUser().tagOrUsername()}`)" + value = "${user.mention} (`${user.id.value}` / `${user.asUser().tag}`)" } } @@ -519,7 +519,7 @@ class FilterExtension : Extension() { field { name = "Moderator" - value = "${user.mention} (`${user.id.value}` / `${user.asUser().tagOrUsername()}`)" + value = "${user.mention} (`${user.id.value}` / `${user.asUser().tag}`)" } } @@ -562,7 +562,7 @@ class FilterExtension : Extension() { field { name = "Moderator" - value = "${user.mention} (`${user.id.value}` / `${user.asUser().tagOrUsername()}`)" + value = "${user.mention} (`${user.id.value}` / `${user.asUser().tag}`)" } } @@ -758,7 +758,7 @@ class FilterExtension : Extension() { field { inline = true name = "User" - value = "${member.mention} (`${member.id}` / `${member.tagOrUsername()}`)" + value = "${member.mention} (`${member.id}` / `${member.tag}`)" } field { @@ -974,7 +974,7 @@ class FilterExtension : Extension() { field { inline = true name = "Author" - value = "${message.author!!.mention} (`${message.author!!.id.value}` / `${message.author!!.tagOrUsername()}`)" + value = "${message.author!!.mention} (`${message.author!!.id.value}` / `${message.author!!.tag}`)" } field { diff --git a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/messagelog/MessageLogExtension.kt b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/messagelog/MessageLogExtension.kt index a05315e..f3aed87 100644 --- a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/messagelog/MessageLogExtension.kt +++ b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/messagelog/MessageLogExtension.kt @@ -13,7 +13,6 @@ import com.kotlindiscord.kord.extensions.extensions.event import com.kotlindiscord.kord.extensions.utils.deltas.MessageDelta import com.kotlindiscord.kord.extensions.utils.getJumpUrl import com.kotlindiscord.kord.extensions.utils.isEphemeral -import com.kotlindiscord.kord.extensions.utils.tagOrUsername import dev.kord.common.entity.Snowflake import dev.kord.common.entity.optional.Optional import dev.kord.core.entity.Guild @@ -108,7 +107,7 @@ class MessageLogExtension : Extension() { messages += "**ID:** ${it.id.value}\n\n" if (it.author != null) { - messages += "**Author:** ${it.author!!.tagOrUsername()}\n" + messages += "**Author:** ${it.author!!.tag}\n" messages += "**Author ID:** ${it.author!!.id.value}\n\n" } else { messages += "**Display Name:** ${it.data.author.username}\n" @@ -552,7 +551,7 @@ class MessageLogExtension : Extension() { field { name = "Author ID/Tag" - value = "`${author.id.value}` / `${author.tagOrUsername()}`" + value = "`${author.id.value}` / `${author.tag}`" inline = true } } else {