1
0
mirror of https://github.com/fumiama/NanoBot.git synced 2026-06-05 10:40:24 +08:00

optimize: trim content

This commit is contained in:
源文雨
2023-11-17 23:12:25 +09:00
parent 594c9fddfe
commit 3c2b37d5d7

View File

@@ -115,6 +115,7 @@ func (bot *Bot) processEvent(payload *WebsocketPayload) {
func match(ctx *Ctx, matchers []*Matcher) {
if ctx.Message != nil && ctx.Message.Content != "" { // 确保无空
ctx.Message.Content = strings.TrimSpace(ctx.Message.Content)
if !ctx.IsToMe {
ctx.IsToMe = func(ctx *Ctx) bool {
name := ctx.GetReady().User.Username