feat(Bocchi): init
This commit is contained in:
parent
5df56646c7
commit
1bc5341a31
4 changed files with 64 additions and 1 deletions
|
|
@ -1,5 +1,9 @@
|
|||
# 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)
|
||||
|
||||
Apply the role colour as a background of usernames, improving contrast with some role colours
|
||||
|
|
|
|||
16
plugins/Bocchi/build.gradle.kts
Normal file
16
plugins/Bocchi/build.gradle.kts
Normal 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)
|
||||
}
|
||||
|
|
@ -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)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -24,6 +24,7 @@ rootProject.name = "Awoocord"
|
|||
val plugins = mapOf(
|
||||
"ComponentsV2Beta" to "canary/ComponentsV2",
|
||||
"SlashCommandsFixBeta" to "canary/SlashCommandsFix",
|
||||
"Clump" to "plugins/Bocchi",
|
||||
"Scout" to "plugins/Scout",
|
||||
"RoleBlocks" to "plugins/Zinnia",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue