mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 22:07:10 +00:00
fix: 只有管理员和群主才能用jinyan和kickout
This commit is contained in:
parent
599f37e627
commit
351597a33d
3 changed files with 39 additions and 8 deletions
|
|
@ -27,5 +27,5 @@ export class KickOutTool extends AbstractTool {
|
|||
return `the user ${qq} has been kicked out from group ${groupId}`
|
||||
}
|
||||
|
||||
description = 'Useful when you want to kick someone out of the group. The input to this tool should be the group number, the qq number of the one who should be kicked out, these two number should be concated with a space. '
|
||||
description = 'Useful when you want to kick someone out of the group. '
|
||||
}
|
||||
|
|
|
|||
29
utils/tools/WebsiteTool.js
Normal file
29
utils/tools/WebsiteTool.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { AbstractTool } from './AbstractTool.js'
|
||||
|
||||
export class WebsiteTool extends AbstractTool {
|
||||
name = 'website'
|
||||
|
||||
parameters = {
|
||||
properties: {
|
||||
url: {
|
||||
type: 'string',
|
||||
description: '要访问的网站网址'
|
||||
}
|
||||
},
|
||||
required: ['url']
|
||||
}
|
||||
|
||||
func = async function (opts) {
|
||||
let { url } = opts
|
||||
let res = await fetch(url, {
|
||||
headers: {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'
|
||||
}
|
||||
})
|
||||
let text = await res.text()
|
||||
text = text.slice(0, Math.min(text.length, 4000))
|
||||
return `this is part of the content of website:\n ${text}`
|
||||
}
|
||||
|
||||
description = 'Useful when you want to browse a website by url'
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue