mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
🦄 reactor: 优化触发词
This commit is contained in:
parent
9962676498
commit
40ea2c01ea
@ -57,7 +57,7 @@ export class songRequest extends plugin {
|
|||||||
permission: 'master'
|
permission: 'master'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
reg: '^#?获取群文件$',
|
reg: '^#?群文件上传云盘$|#rngu|#RNGU',
|
||||||
fnc: 'getLatestDocument',
|
fnc: 'getLatestDocument',
|
||||||
permission: 'master'
|
permission: 'master'
|
||||||
}
|
}
|
||||||
@ -411,17 +411,15 @@ export class songRequest extends plugin {
|
|||||||
async getLatestDocument(e) {
|
async getLatestDocument(e) {
|
||||||
const autoSelectNeteaseApi = await this.pickApi()
|
const autoSelectNeteaseApi = await this.pickApi()
|
||||||
const cleanPath = await getGroupFileUrl(e)
|
const cleanPath = await getGroupFileUrl(e)
|
||||||
logger.info(cleanPath)
|
|
||||||
// 拓展名
|
// 拓展名
|
||||||
const extension = cleanPath.match(/\.\w+$/);
|
const extension = cleanPath.match(/\.\w+$/);
|
||||||
// 获取文件路径
|
// 获取文件路径
|
||||||
const dirPath = cleanPath.substring(0, cleanPath.lastIndexOf('/'));
|
const dirPath = cleanPath.substring(0, cleanPath.lastIndexOf('/'));
|
||||||
// 获取文件名
|
// 获取文件名
|
||||||
const fileName = cleanPath.split('/').pop().replace(/\.\w+$/, '');
|
const fileName = cleanPath.split('/').pop().replace(/\.\w+$/, '');
|
||||||
logger.info(fileName)
|
// 进行文件名拆解
|
||||||
const parts = fileName.trim().match(/^([\s\S]+)\s*-\s*([\s\S]+)$/);
|
const parts = fileName.trim().match(/^([\s\S]+)\s*-\s*([\s\S]+)$/);
|
||||||
logger.info(parts)
|
const newFileName = dirPath + '/' + parts[2].replace(/^\s+|\s+$/g, '') + extension
|
||||||
const newFileName = dirPath + '/' + parts[2].trim() + extension
|
|
||||||
// 进行元数据编辑
|
// 进行元数据编辑
|
||||||
if (parts) {
|
if (parts) {
|
||||||
const tags = {
|
const tags = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user