mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
🌈 style: 更改名字
This commit is contained in:
parent
359cd4f2b8
commit
851e486b36
@ -10,8 +10,8 @@ let helpData = {
|
|||||||
export class help extends plugin {
|
export class help extends plugin {
|
||||||
constructor (e) {
|
constructor (e) {
|
||||||
super({
|
super({
|
||||||
name: 'RConsole插件帮助',
|
name: 'rconsole插件帮助',
|
||||||
dsc: 'RConsole插件帮助插件帮助',
|
dsc: 'rconsole插件帮助插件帮助',
|
||||||
event: 'message',
|
event: 'message',
|
||||||
priority: 500,
|
priority: 500,
|
||||||
rule: [
|
rule: [
|
||||||
|
@ -27,4 +27,28 @@ export class tools extends plugin {
|
|||||||
.catch((err) => logger.error(err))
|
.catch((err) => logger.error(err))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 抖音解析
|
||||||
|
async douyin(e) {
|
||||||
|
const urlRex = /(http:|https:)\/\/v.douyin.com\/[A-Za-z\\d._?%&+\-=\/#]*/g
|
||||||
|
puppeteer.launch().then(async browser => {
|
||||||
|
const page = await browser.newPage();
|
||||||
|
await page.goto(urlRex.exec(e.msg.trim())[0]);
|
||||||
|
const headers = page.headers()
|
||||||
|
console.log(headers)
|
||||||
|
await browser.close();
|
||||||
|
});
|
||||||
|
const douyinRex = /.*video\/(\d+)\/(.*?)/g
|
||||||
|
const resolver = douyinRex.exec(location)
|
||||||
|
const url = `https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids=${resolver}`
|
||||||
|
e.reply('解析中...')
|
||||||
|
const res = fetch(url, {
|
||||||
|
headers: {
|
||||||
|
'User-Agent': "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Mobile Safari/537.36"
|
||||||
|
},
|
||||||
|
timeout: 10000
|
||||||
|
}).then(resp => {
|
||||||
|
return resp.body
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,11 +44,11 @@
|
|||||||
- group: 其他指令[实验]
|
- group: 其他指令[实验]
|
||||||
list:
|
list:
|
||||||
- icon: 问号
|
- icon: 问号
|
||||||
title: "#RConsole插件版本"
|
title: "#rconsole插件版本"
|
||||||
desc: "查看,最近维护的版本信息"
|
desc: "查看,最近维护的版本信息"
|
||||||
- icon: 史莱姆
|
- icon: 史莱姆
|
||||||
title: "#RConsole插件更新"
|
title: "#rconsole插件更新"
|
||||||
desc: "进行更新RConsole插件"
|
desc: "进行更新rconsole插件"
|
||||||
- icon: 原石
|
- icon: 原石
|
||||||
title: "#RConsole插件强制更新"
|
title: "#rconsole插件强制更新"
|
||||||
desc: "进行强制更新RConsole插件"
|
desc: "进行强制更新rconsole插件"
|
4
index.js
4
index.js
@ -4,12 +4,12 @@ import RConfig from './model/index.js'
|
|||||||
const versionData = RConfig.getConfig('version')
|
const versionData = RConfig.getConfig('version')
|
||||||
|
|
||||||
logger.info('--------------------------')
|
logger.info('--------------------------')
|
||||||
logger.info(`RConsole插件${versionData[0].version}初始化~`)
|
logger.info(`rconsole插件${versionData[0].version}初始化~`)
|
||||||
logger.info('--------------------------')
|
logger.info('--------------------------')
|
||||||
|
|
||||||
// 读取功能
|
// 读取功能
|
||||||
const files = fs
|
const files = fs
|
||||||
.readdirSync('./plugins/RConsole-plugin/apps')
|
.readdirSync('./plugins/rconsole-plugin/apps')
|
||||||
.filter((file) => file.endsWith('.js'))
|
.filter((file) => file.endsWith('.js'))
|
||||||
|
|
||||||
let apps = {}
|
let apps = {}
|
||||||
|
@ -2,12 +2,12 @@ export default class base {
|
|||||||
constructor (e = {}) {
|
constructor (e = {}) {
|
||||||
this.e = e
|
this.e = e
|
||||||
this.userId = e?.user_id
|
this.userId = e?.user_id
|
||||||
this.model = 'RConsole-plugin'
|
this.model = 'rconsole-plugin'
|
||||||
this._path = process.cwd().replace(/\\/g, '/')
|
this._path = process.cwd().replace(/\\/g, '/')
|
||||||
}
|
}
|
||||||
|
|
||||||
get prefix () {
|
get prefix () {
|
||||||
return `Yz:RConsole-plugin:${this.model}:`
|
return `Yz:rconsole-plugin:${this.model}:`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -19,9 +19,9 @@ export default class base {
|
|||||||
get screenData () {
|
get screenData () {
|
||||||
return {
|
return {
|
||||||
saveId: this.userId,
|
saveId: this.userId,
|
||||||
tplFile: `./plugins/RConsole-plugin/resources/html/${this.model}/${this.model}.html`,
|
tplFile: `./plugins/rconsole-plugin/resources/html/${this.model}/${this.model}.html`,
|
||||||
/** 绝对路径 */
|
/** 绝对路径 */
|
||||||
pluResPath: `${this._path}/plugins/RConsole-plugin/resources/`
|
pluResPath: `${this._path}/plugins/rconsole-plugin/resources/`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import chokidar from 'chokidar'
|
|||||||
class RConfig {
|
class RConfig {
|
||||||
constructor () {
|
constructor () {
|
||||||
// 配置文件
|
// 配置文件
|
||||||
this.configPath = './plugins/RConsole-plugin/config/'
|
this.configPath = './plugins/rconsole-plugin/config/'
|
||||||
this.config = {}
|
this.config = {}
|
||||||
|
|
||||||
// 监听文件
|
// 监听文件
|
||||||
|
Loading…
x
Reference in New Issue
Block a user