修复汉字转换周天错误

This commit is contained in:
fumiama 2021-05-10 13:09:16 +08:00
parent 8801b8659b
commit 32eed9a4d8

View File

@ -151,6 +151,9 @@ func chineseNum2Int(rs []rune) int8 {
//处理单个字符的映射0~10 //处理单个字符的映射0~10
func chineseChar2Int(c rune) int { func chineseChar2Int(c rune) int {
if c == rune('日') || c == rune('天') { //周日/周天
return 7
} else {
match := []rune("零一二三四五六七八九十") match := []rune("零一二三四五六七八九十")
for i, m := range match { for i, m := range match {
if c == m { if c == m {
@ -159,6 +162,7 @@ func chineseChar2Int(c rune) int {
} }
return 0 return 0
} }
}
//@全体成员 //@全体成员
func AtAll() message.MessageSegment { func AtAll() message.MessageSegment {