feat: Discord 渠道添加 Nitro 会员开关,支持 25MB 上传

This commit is contained in:
axibayuit
2025-12-30 15:39:39 +08:00
parent f291ce3a15
commit 07f2683120
17 changed files with 16 additions and 14 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

BIN
css/357.1ca52a5a.css.gz Normal file

Binary file not shown.

View File

@@ -567,10 +567,12 @@ async function uploadFileToDiscord(context, fullId, metadata, returnLink) {
const fileSize = file.size;
const fileName = metadata.FileName;
// Discord 免费用户限制 10MB,超过则返回错误让其他渠道处理
const DISCORD_MAX_SIZE = 10 * 1024 * 1024; // 10MB
// Discord 文件大小限制Nitro 会员 25MB免费用户 10MB
const isNitro = discordChannel.isNitro || false;
const DISCORD_MAX_SIZE = isNitro ? 25 * 1024 * 1024 : 10 * 1024 * 1024;
if (fileSize > DISCORD_MAX_SIZE) {
return createResponse('Error: File size exceeds Discord limit (10MB), please use another channel', { status: 413 });
const limitMB = isNitro ? 25 : 10;
return createResponse(`Error: File size exceeds Discord limit (${limitMB}MB), please use another channel`, { status: 413 });
}
const discordAPI = new DiscordAPI(discordChannel.botToken);

View File

@@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/logo.png"><link rel="apple-touch-icon" href="/logo.png"><link rel="mask-icon" href="/logo.png" color="#f4b400"><meta name="description" content="Sanyue ImgHub - A modern file hosting platform"><meta name="keywords" content="Sanyue, ImgHub, file hosting, image hosting, cloud storage"><meta name="author" content="SanyueQi"><title>Sanyue ImgHub</title><script defer="defer" src="/js/chunk-vendors.780b6559.js"></script><script defer="defer" src="/js/app.8353468e.js"></script><link href="/css/chunk-vendors.4363ed49.css" rel="stylesheet"><link href="/css/app.14879ca1.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but sanyue_imghub doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/logo.png"><link rel="apple-touch-icon" href="/logo.png"><link rel="mask-icon" href="/logo.png" color="#f4b400"><meta name="description" content="Sanyue ImgHub - A modern file hosting platform"><meta name="keywords" content="Sanyue, ImgHub, file hosting, image hosting, cloud storage"><meta name="author" content="SanyueQi"><title>Sanyue ImgHub</title><script defer="defer" src="/js/chunk-vendors.780b6559.js"></script><script defer="defer" src="/js/app.6d1ac7b7.js"></script><link href="/css/chunk-vendors.4363ed49.css" rel="stylesheet"><link href="/css/app.14879ca1.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but sanyue_imghub doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

BIN
js/357.c54040b4.js.gz Normal file

Binary file not shown.

1
js/357.c54040b4.js.map Normal file

File diff suppressed because one or more lines are too long

BIN
js/357.c54040b4.js.map.gz Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
js/app.6d1ac7b7.js.map.gz Normal file

Binary file not shown.

Binary file not shown.