feat(Bocchi): init

This commit is contained in:
Cilly Leang 2026-01-22 23:25:19 +11:00
parent 5df56646c7
commit 1bc5341a31
Signed by: cilly
GPG key ID: 6500251E087653C9
4 changed files with 64 additions and 1 deletions

View file

@ -1,5 +1,9 @@
# Awoocord Plugins # Awoocord Plugins
## [Clump](plugins/Bocchi) | [Download](https://github.com/LavaDesu/Awoocord/raw/builds/Clump.zip)
Group messages more leniently (e.g. mentions, attachments, etc..), reducing clutter and wasted space.
## [RoleBlocks](plugins/Zinnia) | [Download](https://github.com/LavaDesu/Awoocord/raw/builds/RoleBlocks.zip) ## [RoleBlocks](plugins/Zinnia) | [Download](https://github.com/LavaDesu/Awoocord/raw/builds/RoleBlocks.zip)
Apply the role colour as a background of usernames, improving contrast with some role colours Apply the role colour as a background of usernames, improving contrast with some role colours
@ -19,4 +23,4 @@ Fixes slash commands not showing up.
## [ComponentsV2](canary/ComponentsV2) | [Download](https://github.com/LavaDesu/Awoocord/raw/builds/ComponentsV2Beta.zip) ## [ComponentsV2](canary/ComponentsV2) | [Download](https://github.com/LavaDesu/Awoocord/raw/builds/ComponentsV2Beta.zip)
Fix missing/empty bot messages using the new embed system. Such messages will be marked "CV2" as part of its tag. Fix missing/empty bot messages using the new embed system. Such messages will be marked "CV2" as part of its tag.

View file

@ -0,0 +1,16 @@
version = "1.0.0"
description = "More lenient message grouping"
android {
namespace = "moe.lava.awoocord.bocchi"
}
aliucord {
// Changelog of your plugin
changelog.set("""
# 1.0.0
* Initial release >w<
""".trimIndent())
deploy.set(true)
}

View file

@ -0,0 +1,42 @@
package moe.lava.awoocord.bocchi
import android.content.Context
import com.aliucord.annotations.AliucordPlugin
import com.aliucord.entities.Plugin
import com.aliucord.patcher.*
import com.discord.api.message.MessageTypes
import com.discord.models.message.Message
import com.discord.widgets.chat.list.model.WidgetChatListModelMessages
@AliucordPlugin
@Suppress("unused")
class Bocchi : Plugin() {
override fun start(context: Context) {
patcher.instead<WidgetChatListModelMessages.Companion>(
"shouldConcatMessage",
WidgetChatListModelMessages.Items::class.java,
Message::class.java,
Message::class.java,
) { (_, items: WidgetChatListModelMessages.Items, message: Message, message2: Message?) ->
val timeDiff = (message.timestamp?.g() ?: 0L) - (message2?.timestamp?.g() ?: 0L)
return@instead !(
message2 == null ||
message2.isSystemMessage ||
message.hasThread() ||
message2.hasThread() ||
message.type !in arrayOf(MessageTypes.DEFAULT, MessageTypes.LOCAL) ||
message.author.id != message2.author.id ||
timeDiff >= 420000 || // WidgetChatListModelMessages.MESSAGE_CONCAT_TIMESTAMP_DELTA_THRESHOLD
// items.listItemMostRecentlyAdded.type !in arrayOf(0, 1, 4, 21) ||
// message2.hasAttachments() ||
// message2.hasEmbeds() ||
// message2.mentions?.isNotEmpty() == true ||
// message.mentions?.isNotEmpty() == true ||
// message.hasAttachments() ||
// message.hasEmbeds() ||
items.concatCount >= 5 ||
(message.isWebhook && message.author?.username == message2.author.username)
)
}
}
}

View file

@ -24,6 +24,7 @@ rootProject.name = "Awoocord"
val plugins = mapOf( val plugins = mapOf(
"ComponentsV2Beta" to "canary/ComponentsV2", "ComponentsV2Beta" to "canary/ComponentsV2",
"SlashCommandsFixBeta" to "canary/SlashCommandsFix", "SlashCommandsFixBeta" to "canary/SlashCommandsFix",
"Clump" to "plugins/Bocchi",
"Scout" to "plugins/Scout", "Scout" to "plugins/Scout",
"RoleBlocks" to "plugins/Zinnia", "RoleBlocks" to "plugins/Zinnia",
) )