-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
222 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,51 @@ | ||
content: | ||
command: pet | ||
probability: 30 | ||
antialias: true | ||
disabled: [] | ||
commandHead: '' | ||
respondSelfNudge: false | ||
respondReply: true | ||
cachePoolSize: 10000 | ||
keyListFormat: FORWARD | ||
disablePolicy: FULL | ||
disabledGroups: [] | ||
fuzzy: false | ||
strictCommand: true | ||
synchronized: false | ||
gifEncoder: ANIMATED_LIB | ||
gifMaxSize: | ||
- 200 | ||
- 200 | ||
- 32 | ||
gifQuality: 90 | ||
headless: true | ||
autoUpdate: true | ||
repositoryUrl: 'https://raw.githubusercontent.com/Dituon/petpet/main' | ||
devMode: false | ||
# 触发 petpet 的指令 | ||
command: pet | ||
# 使用 戳一戳 的触发概率 | ||
probability: 30 | ||
# 是否使用抗锯齿 | ||
antialias: true | ||
# 禁用列表 | ||
disabled: [] | ||
# keyCommand前缀 | ||
commandHead: '' | ||
# 是否响应机器人发出的戳一戳 | ||
respondSelfNudge: false | ||
# 是否使用响应回复 | ||
respondReply: true | ||
# 消息缓存池容量 | ||
cachePoolSize: 10000 | ||
# keyList响应格式 | ||
keyListFormat: FORWARD | ||
# 禁用策略 | ||
disablePolicy: FULL | ||
# 禁用群聊列表 | ||
disabledGroups: [] | ||
# 是否使用模糊匹配用户名 | ||
fuzzy: false | ||
# 是否使用严格匹配模式 | ||
strictCommand: true | ||
# 是否使用消息事件同步锁 | ||
synchronized: false | ||
# GIF编码器 | ||
gifEncoder: ANIMATED_LIB | ||
# GIF缩放阈值/尺寸 | ||
gifMaxSize: | ||
- 200 | ||
- 200 | ||
- 32 | ||
# GIF质量, 仅适用于ANIMATED_LIB编码器 | ||
gifQuality: 90 | ||
# 是否使用headless模式 | ||
headless: true | ||
# 是否自动从仓库同步PetData | ||
autoUpdate: true | ||
# 用于自动更新的仓库地址 | ||
repositoryUrl: 'https://raw.githubusercontent.com/Dituon/petpet/main' | ||
# 是否启用开发模式(支持热重载) | ||
devMode: false | ||
# 触发图片生成后的用户冷却时长(填入-1则禁用,单位为秒) | ||
coolDown: 10 | ||
# 触发图片生成后的群聊冷却时长 | ||
groupCoolDown: -1 | ||
# 触发冷却后的回复消息, '[nudge]'为戳一戳 | ||
inCoolDownMessage: 技能冷却中... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": 4.8, | ||
"version": 4.9, | ||
"dataList": [ | ||
"peep", | ||
"watch_tv", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package xmmt.dituon.server | ||
|
||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.Serializer | ||
import kotlinx.serialization.encodeToString | ||
import kotlinx.serialization.json.Json | ||
import xmmt.dituon.share.AvatarType | ||
import xmmt.dituon.share.BasePetService.VERSION | ||
import xmmt.dituon.share.KeyData | ||
import kotlin.streams.toList | ||
|
||
@Serializable | ||
data class PetDataDTO( | ||
val version: Float = VERSION, | ||
val petData: List<PetDataObject> | ||
) { | ||
companion object { | ||
@JvmStatic | ||
fun encodeToString(dataMap: Map<String, KeyData>): String{ | ||
val dataList: ArrayList<PetDataObject> = ArrayList() | ||
dataMap.forEach { (key, data) -> | ||
dataList.add(PetDataObject(key, data.avatar.stream().map { a -> a.type }.toList())) | ||
} | ||
return Json.encodeToString( | ||
PetDataDTO(VERSION, dataList) | ||
) | ||
} | ||
} | ||
} | ||
|
||
@Serializable | ||
data class PetDataObject( | ||
val key: String, | ||
val types: List<AvatarType> | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package xmmt.dituon.server | ||
|
||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.decodeFromString | ||
import kotlinx.serialization.json.Json | ||
|
||
@Serializable | ||
data class RequestDTO( | ||
val key: String, | ||
val form: TargetDTO = TargetDTO("form", ""), | ||
val to: TargetDTO = TargetDTO("to", ""), | ||
val group: TargetDTO = TargetDTO("group", ""), | ||
val bot: TargetDTO = TargetDTO("bot", ""), | ||
val textList: List<String> = emptyList() | ||
) { | ||
companion object { | ||
@JvmStatic | ||
fun decodeFromString(json: String): RequestDTO { | ||
return Json.decodeFromString(json) | ||
} | ||
} | ||
} | ||
|
||
@Serializable | ||
data class TargetDTO( | ||
val name: String, | ||
val avatar: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.