Skip to content

Commit

Permalink
洗魔方功能
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed May 14, 2024
1 parent f6f01b4 commit 20b9c50
Show file tree
Hide file tree
Showing 6 changed files with 40,185 additions and 20 deletions.
15 changes: 14 additions & 1 deletion maplebot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,17 @@ image_expire_hours: 72
> ├── YinYangJade
> │ ├── config.yml
> │ ├── YinYangJade
> ```
> ```

## 开发相关

### 中文乱码问题

对于“洗魔方”功能,如遇Linux下中文乱码,请将**宋体**文件`simsun.ttc`放入`/usr/share/fonts`中,然后执行以下shell

```shell
# 刷新字体缓存
fc-cache
# 查看是否有宋体
fc-list :lang=zh | grep 宋体
```
2 changes: 2 additions & 0 deletions maplebot/bots.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ func handleGroupMessage(message *GroupMessage) bool {
if itemLevel, err := strconv.Atoi(content); err == nil {
sendGroupMessage(message.Sender.Group.Id, calculateStarForce2(itemLevel, true, true)...)
}
} else if strings.HasPrefix(plain.Text, "洗魔方 ") {
sendGroupMessage(message.Sender.Group.Id, calculateCube(strings.TrimSpace(plain.Text[len("洗魔方"):]))...)
} else if perm && strings.HasPrefix(plain.Text, "添加词条 ") {
key := dealKey(plain.Text[len("添加词条"):])
if strings.Contains(key, ".") {
Expand Down
Loading

0 comments on commit 20b9c50

Please # to comment.