⚗️ 新增#设置机型
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# 1.2.6
|
||||
|
||||
* 新增`jimp`依赖用于生成点赞回复图片
|
||||
* 新增`#设置机型`ⁿᵉʷ
|
||||
|
||||
|
||||
# # 1.2.1 ~ 1.2.5
|
||||
|
||||
@@ -136,6 +136,11 @@ export class Assistant extends plugin {
|
||||
reg: friendTypeReg, // 更改好友申请方式
|
||||
fnc: 'FriendType',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '#设置机型.*', // 更改好友申请方式
|
||||
fnc: 'setModel',
|
||||
permission: 'master'
|
||||
}
|
||||
]
|
||||
})
|
||||
@@ -774,4 +779,10 @@ export class Assistant extends plugin {
|
||||
if (result.ret != 0) return e.reply('❎ 未知错误\n' + JSON.stringify(result))
|
||||
e.reply(`✅ 已${/开启/.test(e.msg) ? '开启' : '关闭'}戳一戳功能`)
|
||||
}
|
||||
|
||||
async setModel (e) {
|
||||
let model = e.msg.replace(/#|设置机型/g, '')
|
||||
let res = await QQApi.setModel(model).catch(err => logger.error(err))
|
||||
e.reply(_.get(res, ['13031', 'data', 'rsp', 'iRet']) == 0 ? '设置成功' : '设置失败')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export default new class {
|
||||
if (options.params) {
|
||||
url = url + '?' + qs(options.params)
|
||||
}
|
||||
logger.debug(`[Yenai-Plugin]GET请求:${decodeURI(url)}`)
|
||||
logger.debug(`[Yenai-Plugin] GET请求:${decodeURI(url)}`)
|
||||
options.headers = {
|
||||
'User-Agent': CHROME_UA,
|
||||
...options.headers
|
||||
@@ -95,7 +95,7 @@ export default new class {
|
||||
if (options.params) {
|
||||
url = url + '?' + qs(options.params)
|
||||
}
|
||||
logger.debug(`[Yenai-Plugin]POST请求:${decodeURI(url)}`)
|
||||
logger.debug(`[Yenai-Plugin] POST请求:${decodeURI(url)}`)
|
||||
if (options.data) {
|
||||
if (/json/.test(options.headers['Content-Type'])) {
|
||||
options.body = JSON.stringify(options.data)
|
||||
|
||||
@@ -514,8 +514,13 @@ export default new class {
|
||||
})
|
||||
}
|
||||
|
||||
/** 设置机型 */
|
||||
async setModelShow (modelName, modelShow) {
|
||||
/**
|
||||
* 自定义机型
|
||||
* @param {string} modelName
|
||||
* @param {string} modelShow
|
||||
* @returns
|
||||
*/
|
||||
async setModel (modelName) {
|
||||
const url = 'https://proxy.vip.qq.com/cgi-bin/srfentry.fcgi'
|
||||
const data = {
|
||||
'13031': {
|
||||
@@ -525,8 +530,8 @@ export default new class {
|
||||
iAppType: 0,
|
||||
sIMei: Bot.device.imei,
|
||||
bShowInfo: true,
|
||||
sModelShow: encodeURIComponent(modelShow),
|
||||
bRecoverDefault: false
|
||||
sModelShow: encodeURIComponent(modelName),
|
||||
bRecoverDefault: !modelName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user