mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 22:07:10 +00:00
fix: 修复管理员权限判断问题(可能吧)
This commit is contained in:
parent
ef72d886a5
commit
2e679b5d0f
3 changed files with 17 additions and 61 deletions
|
|
@ -1926,6 +1926,7 @@ export class chatgpt extends plugin {
|
|||
option = Object.assign(option, conversation)
|
||||
}
|
||||
let isAdmin = e.sender.role === 'admin' || e.sender.role === 'owner'
|
||||
let sender = e.sender.user_id
|
||||
let tools = [
|
||||
new SearchVideoTool(),
|
||||
new SendVideoTool(),
|
||||
|
|
@ -1936,8 +1937,8 @@ export class chatgpt extends plugin {
|
|||
new EditCardTool(),
|
||||
new QueryStarRailTool(),
|
||||
new WebsiteTool(),
|
||||
new JinyanTool(isAdmin, e.sender.user_id),
|
||||
new KickOutTool(isAdmin, e.sender.user_id)
|
||||
new JinyanTool(),
|
||||
new KickOutTool()
|
||||
]
|
||||
// if (e.sender.role === 'admin' || e.sender.role === 'owner') {
|
||||
// tools.push(...[new JinyanTool(), new KickOutTool()])
|
||||
|
|
@ -1959,7 +1960,7 @@ export class chatgpt extends plugin {
|
|||
logger.info(msg)
|
||||
while (msg.functionCall) {
|
||||
let { name, arguments: args } = msg.functionCall
|
||||
let functionResult = await funcMap[name].exec(JSON.parse(args))
|
||||
let functionResult = await funcMap[name].exec(Object.assign({isAdmin, sender}, JSON.parse(args)))
|
||||
logger.mark(`function ${name} execution result: ${functionResult}`)
|
||||
option.parentMessageId = msg.id
|
||||
option.name = name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue