mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 05:27:59 +08:00
plugin: add banwords plugin
This commit is contained in:
4
plugins/godcmd/config.json.template
Normal file
4
plugins/godcmd/config.json.template
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"password": "",
|
||||
"admin_users": []
|
||||
}
|
||||
@@ -273,9 +273,13 @@ class Godcmd(Plugin):
|
||||
|
||||
if isadmin:
|
||||
return False,"管理员账号无需认证"
|
||||
|
||||
|
||||
if len(self.password) == 0:
|
||||
return False,"未设置口令,无法认证"
|
||||
|
||||
if len(args) != 1:
|
||||
return False,"请提供口令"
|
||||
|
||||
password = args[0]
|
||||
if password == self.password:
|
||||
self.admin_users.append(userid)
|
||||
|
||||
Reference in New Issue
Block a user