mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-01-31 09:03:19 +08:00
feat: Discord 渠道添加 Nitro 会员开关,支持 25MB 上传
This commit is contained in:
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
css/357.1ca52a5a.css.gz
Normal file
BIN
css/357.1ca52a5a.css.gz
Normal file
Binary file not shown.
@@ -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);
|
||||
|
||||
@@ -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
BIN
js/357.c54040b4.js.gz
Normal file
Binary file not shown.
1
js/357.c54040b4.js.map
Normal file
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
BIN
js/357.c54040b4.js.map.gz
Normal file
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/app.6d1ac7b7.js.map.gz
Normal file
BIN
js/app.6d1ac7b7.js.map.gz
Normal file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user