From 6b2fb8c5d1541c2ac4c1a97e64e1b8b50c62e65d Mon Sep 17 00:00:00 2001 From: NoComment Date: Mon, 15 Jul 2024 16:04:33 +0100 Subject: [PATCH] Fix auto-threading not working when content aware naming is on and the message posted is just an image. This was because when we take the first 75 characters of the content aware name, it makes the string no longer null and just an empty string, so the check to see if the string was null (empty) was being bypassed. Simple fix as show in the commit --- docs/commands.md | 2 +- .../org/hyacinthbots/lilybot/extensions/events/AutoThreading.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/commands.md b/docs/commands.md index 94f7fc49..b5e9e29d 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -37,7 +37,7 @@ None * **Arguments**: * `channel` - The channel to view the auto-threading settings for. - Channel -Hopefull--- +--- ### Command name: `clear count` **Description**: Clear a specific count of messages diff --git a/src/main/kotlin/org/hyacinthbots/lilybot/extensions/events/AutoThreading.kt b/src/main/kotlin/org/hyacinthbots/lilybot/extensions/events/AutoThreading.kt index 8f895248..1cf17ece 100644 --- a/src/main/kotlin/org/hyacinthbots/lilybot/extensions/events/AutoThreading.kt +++ b/src/main/kotlin/org/hyacinthbots/lilybot/extensions/events/AutoThreading.kt @@ -505,7 +505,7 @@ class AutoThreading : Extension() { var threadName: String? = event.message.content.trim().split("\n").firstOrNull()?.take(75) - if (!options.contentAwareNaming || threadName == null) { + if (!options.contentAwareNaming || threadName.isNullOrEmpty()) { threadName = "Thread for ${ message?.author?.asUser()?.username ?: proxiedMessage?.member?.name }".take(75)