Skip to content

Commit

Permalink
build: 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Dec 20, 2022
1 parent c839d9e commit aa6700f
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 48 deletions.
Binary file added .github/afdian.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "xyz.cssxsh"
version = "2.0.0"
version = "2.0.1"

mavenCentralPublish {
useCentralS01()
Expand Down Expand Up @@ -40,7 +40,7 @@ dependencies {
implementation("io.ktor:ktor-client-okhttp")
implementation("io.ktor:ktor-client-encoding")
//
implementation(platform("org.slf4j:slf4j-parent:2.0.5"))
implementation(platform("org.slf4j:slf4j-parent:2.0.6"))
testImplementation("org.slf4j:slf4j-simple")
}

Expand Down
8 changes: 3 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
`{...}`表示连续的多个参数

本插件指令权限ID 格式为 `xyz.cssxsh.mirai.plugin.arknights-helper:command.*`, `*` 是指令的第一指令名
例如 `/公招 远程位 支援` 的权限ID为 `xyz.cssxsh.mirai.plugin.arknights-helper:command.ark-recruit`
例如 `/方舟公招 远程位 支援` 的权限ID为 `xyz.cssxsh.mirai.plugin.arknights-helper:command.ark-recruit`

### 助手抽卡指令

Expand All @@ -35,7 +35,7 @@
| `/<gacha 抽卡> <set 设置> [name]` | 设置卡池为`name`, 默认为`NORMAL` |
| `/<gacha 抽卡> <pool 卡池> [name] [set]? {rules}` | 设置卡池`name`的规则为`rules`,当`set``true`时设置为当前卡池 |

抽卡每一抽会消耗`600`合成玉,合成玉可以通过[答题](#助手答题指令)获得,通过[玩家详情](#助手玩家指令)查看
抽卡每一抽会消耗`600`合成玉,合成玉可以通过[答题](#助手答题指令)获得

#### ArknightsGachaCommand 卡池规则`rules`参数格式

Expand Down Expand Up @@ -160,8 +160,6 @@ B. 选项

- [ ] 配置问题类型出现的概率
- [x] 记录答题正确率 21/06/10
- [x] 明日方舟官方QQ表情,下载、发送更新提醒等 21/05/14
- [x] 自定义材料掉落别名(目前由企鹅物流数据提供支持) 21/05/14
- [ ] 关卡规划
- [x] 周常提醒
- [x] 游戏公告
Expand All @@ -174,4 +172,4 @@ B. 选项

## [爱发电](https://afdian.net/@cssxsh)

![afdian](https://mirai.mamoe.net/assets/uploads/files/1670551864384-8ab9fe4e-37ff-440f-bd1e-c7bda4e1a85e-image.png)
![afdian](.github/afdian.jpg)
8 changes: 4 additions & 4 deletions src/main/kotlin/xyz/cssxsh/arknights/mine/Question.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public data class Question(
)

public enum class QuestionType(public val description: String) {
BUILDING("基建相关") {
BUILDING("基建相关") {
override fun load(loader: QuestionDataLoader): QuestionBuilder {
val building = runBlocking { loader.excel.building() }
val characters = runBlocking { loader.excel.character() }
Expand Down Expand Up @@ -139,7 +139,7 @@ public enum class QuestionType(public val description: String) {
add(handbook.illust to character.name)
}
}
}
}
},
VOICE("声优相关") {
override fun load(loader: QuestionDataLoader): QuestionBuilder {
Expand Down Expand Up @@ -234,9 +234,9 @@ private fun Boolean.Companion.random() = listOf(true, false).random()

private val formatter = DateTimeFormatter.ofPattern("yy-MM-dd HH:mm:ss")

private fun OffsetDateTime.randomDays() = plusDays((-7L .. 7L).random())
private fun OffsetDateTime.randomDays() = plusDays((-7L..7L).random())

private fun OffsetDateTime.randomMinutes() = plusHours((-6L .. 6L).random())
private fun OffsetDateTime.randomMinutes() = plusHours((-6L..6L).random())

private val defaultChoiceRange = 'A'..'D'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import net.mamoe.mirai.utils.*
import kotlin.collections.*

public object ArknightsHelperPlugin : KotlinPlugin(
JvmPluginDescription("xyz.cssxsh.mirai.plugin.arknights-helper", "2.0.0") {
JvmPluginDescription("xyz.cssxsh.mirai.plugin.arknights-helper", "2.0.1") {
name("arknights-helper")
author("cssxsh")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public object ArknightsSubscriber : SimpleListenerHost() {
try {
ArknightsHelperPlugin.dataFolder
ArknightsHelperPlugin
} catch (_: ExceptionInInitializerError) {
} catch (_: UninitializedPropertyAccessException) {
object : PluginFileExtensions {
override val configFolder by lazy { configFolderPath.toFile() }
override val configFolderPath by lazy { Path(System.setProperty("arknights.config", "./config")) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ public object ArknightsDataCommand : CompositeCommand(
@SubCommand("voice", "语音")
public suspend fun UserCommandSender.voice(id: String = "") {
val words = ArknightsSubscriber.excel.word().charWords
val characters = ArknightsSubscriber.excel.character()
val word = words[id] ?: words.values.random()
val character = ArknightsSubscriber.excel.character().getValue(word.character)
val character = characters.getValue(word.character)
ArknightsHelperPlugin.logger.info("${character.name} - ${word.voiceTitle} - ${word.voiceText}")
val file = ArknightsSubscriber.static.voice(character = character, word = word)
val audio = file.toExternalResource().use {
(subject as AudioSupported).uploadAudio(it)
}
val audio = file.toExternalResource().use { (subject as AudioSupported).uploadAudio(it) }
sendMessage(message = audio)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public object ArknightsFaceCommand : CompositeCommand(
bot says {
val head = try {
val bytes = http.get(author.head).body<ByteArray>()
bytes.toExternalResource().use { resource ->
bytes.toExternalResource().use { resource ->
subject.uploadImage(resource)
}
} catch (cause: Exception) {
Expand All @@ -77,7 +77,7 @@ public object ArknightsFaceCommand : CompositeCommand(
bot says {
val thumb = try {
val bytes = http.get(item.thumb).body<ByteArray>()
bytes.toExternalResource().use { resource ->
bytes.toExternalResource().use { resource ->
subject.uploadImage(resource)
}
} catch (cause: Exception) {
Expand Down
29 changes: 0 additions & 29 deletions src/main/kotlin/xyz/cssxsh/mirai/arknights/data/ArknightsConfig.kt

This file was deleted.

0 comments on commit aa6700f

Please sign in to comment.