1
0
mirror of https://github.com/fumiama/NanoBot.git synced 2026-06-12 06:00:29 +08:00

optimize: hide caller & add preblock

This commit is contained in:
源文雨
2023-10-18 13:36:48 +09:00
parent 9c5a9796e1
commit 3bab1f9031
13 changed files with 581 additions and 75 deletions

View File

@@ -321,7 +321,7 @@ func SuperUserPermission(ctx *Ctx) bool {
if msg.Author == nil { // 确保无空
return false
}
for _, su := range ctx.Caller.SuperUsers {
for _, su := range ctx.caller.SuperUsers {
if su == msg.Author.ID {
return true
}
@@ -431,7 +431,7 @@ func MustProvidePhoto(onmessage string, needphohint, failhint string) Rule {
}
// 没有图片就索取
if needphohint != "" {
_, err := ctx.Caller.PostMessageToChannel(msg.ChannelID, &MessagePost{
_, err := ctx.PostMessageToChannel(msg.ChannelID, &MessagePost{
Content: needphohint,
MessageReference: &MessageReference{MessageID: msg.ID},
ReplyMessageID: msg.ID,