Skip to content

Commit a63f900

Browse files
committed
🔖 2.1.4 - append attachment url
1 parent 0df8236 commit a63f900

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = "net.azisaba"
8-
version = "2.1.3"
8+
version = "2.1.4"
99

1010
repositories {
1111
mavenCentral()

src/main/kotlin/net/azisaba/guildchatdiscord/Main.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ suspend fun main() {
5151
val minecraftUuid = DatabaseManager.getMinecraftUUIDByDiscordId(message.author!!.id.value.toLong()) ?: return@on
5252
// return if the author is not member of the guild
5353
InterChatDiscord.guildManager.getMember(guildId, minecraftUuid).exceptionally { null }.join() ?: return@on
54+
55+
var content = message.content
56+
if (message.attachments.isNotEmpty()) content += "\n"
57+
message.attachments.forEach { content += "${it.url}\n" }
5458
// send packet
55-
val packet = GuildMessagePacket(guildId, "Discord", minecraftUuid, message.content, null)
59+
val packet = GuildMessagePacket(guildId, "Discord", minecraftUuid, content.trim('\n'), null)
5660
JedisBoxProvider.get().pubSubHandler.publish(Protocol.GUILD_MESSAGE.name, packet)
5761
}
5862

0 commit comments

Comments
 (0)