mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
✨ feat: 添加哔哩哔哩BV直接跳转
This commit is contained in:
parent
bb32dbf66b
commit
6753bba89c
@ -113,7 +113,7 @@ export class tools extends plugin {
|
|||||||
permission: 'master',
|
permission: 'master',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
reg: "(bilibili.com|b23.tv|t.bilibili.com)",
|
reg: "(bilibili.com|b23.tv|t.bilibili.com|^BV[1-9a-zA-Z]{10}$)",
|
||||||
fnc: "bili",
|
fnc: "bili",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -386,6 +386,11 @@ export class tools extends plugin {
|
|||||||
const urlRex = /(?:https?:\/\/)?www\.bilibili\.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
const urlRex = /(?:https?:\/\/)?www\.bilibili\.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
||||||
const bShortRex = /(http:|https:)\/\/b23.tv\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
const bShortRex = /(http:|https:)\/\/b23.tv\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
||||||
let url = e.msg === undefined ? e.message.shift().data.replaceAll("\\", "") : e.msg.trim().replaceAll("\\", "");
|
let url = e.msg === undefined ? e.message.shift().data.replaceAll("\\", "") : e.msg.trim().replaceAll("\\", "");
|
||||||
|
// 直接发送BV号的处理
|
||||||
|
if (/^BV[1-9a-zA-Z]{10}$/.exec(url)?.[0]) {
|
||||||
|
url = `https://www.bilibili.com/video/${ url }`;
|
||||||
|
logger.info(url)
|
||||||
|
}
|
||||||
// 短号处理
|
// 短号处理
|
||||||
if (url.includes("b23.tv")) {
|
if (url.includes("b23.tv")) {
|
||||||
const bShortUrl = bShortRex.exec(url)?.[0];
|
const bShortUrl = bShortRex.exec(url)?.[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user