fix: 浏览设定页码

This commit is contained in:
ikechan8370 2023-03-26 16:27:33 +08:00
parent bfc55df6a6
commit 90a1f6a084
2 changed files with 9 additions and 3 deletions

View file

@ -208,8 +208,8 @@ let helpData = [
},
{
icon: 'confirm',
title: '#chatgpt浏览设定+关键词',
desc: '搜索公开的设定'
title: '#chatgpt浏览设定(+关键词)(页码X)',
desc: '搜索公开的设定。默认返回前十条使用页码X可以翻页使用关键词可以检索。页码从1开始。'
},
{
icon: 'confirm',

View file

@ -339,7 +339,13 @@ export class help extends plugin {
async browsePrompt (e) {
let search = e.msg.replace(/^#(chatgpt|ChatGPT)(在线)?(浏览|查找)设定/, '')
let response = await fetch('https://chatgpt.roki.best/prompt/list?search=' + search, {
let split = search.split('页码')
let page = 1
if (split.length > 1) {
search = split[0]
page = parseInt(split[1])
}
let response = await fetch('https://chatgpt.roki.best/prompt/list?search=' + search + `&page=${page - 1}`, {
method: 'GET',
headers: {
'FROM-CHATGPT': 'ikechan8370'