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:
1
event.go
1
event.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user