Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 新增黑名单用户及VIP用户处理逻辑,同时修改ALLOW_USERS的校验为userid(SenderStaffId),将用户相关校验统一为userid #190

Merged
merged 20 commits into from
Apr 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update main.go
  • Loading branch information
ffinly authored Apr 9, 2023
commit bfad3ff507ae48e129f3354a54b8bcf3fcc984b3
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func Start() {
logger.Debug(fmt.Sprintf("dingtalk callback parameters: %#v", msgObj))

if public.Config.ChatType != "0" && msgObj.ConversationType != public.Config.ChatType {
_, err = msgObj.ReplyToDingtalk(string(dingbot.MARKDOWN), "** 🤷 很抱歉,管理员禁用了这种聊天方式,请选择其他聊天方式与机器人对话!**")
_, err = msgObj.ReplyToDingtalk(string(dingbot.MARKDOWN), "**🤷 抱歉,管理员禁用了这种聊天方式,请选择其他聊天方式与机器人对话!**")
if err != nil {
logger.Warning(fmt.Errorf("send message error: %v", err))
return err
Expand All @@ -58,7 +58,7 @@ func Start() {
}
// 不在允许群组,不在允许用户(包括在黑名单),满足任一条件,拒绝会话;管理员不受限制
if (!public.JudgeGroup(msgObj.GetChatTitle()) || !public.JudgeUsers(msgObj.SenderStaffId)) && !public.JudgeAdminUsers(msgObj.SenderStaffId) {
_, err = msgObj.ReplyToDingtalk(string(dingbot.MARKDOWN), "** 🤷 很抱歉,您的身份信息未被认证通过,无法使用机器人对话功能。**\n>如需继续使用,请联系管理员申请访问权限。")
_, err = msgObj.ReplyToDingtalk(string(dingbot.MARKDOWN), "**🤷 抱歉,您的身份信息未被认证通过,无法使用机器人对话功能。**\n>如需继续使用,请联系管理员申请访问权限。")
if err != nil {
logger.Warning(fmt.Errorf("send message error: %v", err))
return err
Expand Down