From f6748029989a719647f139f6eb1b003ccfa3a201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:33:21 +0900 Subject: [PATCH] fix: only ruls --- rules.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rules.go b/rules.go index 39b9319..d28f67a 100644 --- a/rules.go +++ b/rules.go @@ -298,6 +298,11 @@ func OnlyDirect(ctx *Ctx) bool { return false } +// OnlyChannel requires that the ctx.Event is channel message +func OnlyChannel(ctx *Ctx) bool { + return !OnlyPrivate(ctx) +} + // OnlyPublic requires that the ctx.Event is public message func OnlyPublic(ctx *Ctx) bool { if ctx.Message != nil && ctx.Message.SrcGuildID != "" {