Skip to content

Commit a4e73aa

Browse files
authored
Merge pull request cmliu#925 from cmliu/beta2.0
fix: 更新sendMessage函数中的请求用量计算,使用最大请求量替代固定值
2 parents 05d6bb8 + e459fd3 commit a4e73aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

_worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ async function sendMessage(BotToken, ChatID, 日志内容, config_JSON) {
12491249
`🔍 <b>路径:</b><code>${请求URL.pathname + 请求URL.search}</code>\n` +
12501250
`🤖 <b>UA:</b><code>${日志内容.UA}</code>\n` +
12511251
`📅 <b>时间:</b>${请求时间}\n` +
1252-
`${config_JSON.CF.Usage.success ? `📊 <b>请求用量:</b>${config_JSON.CF.Usage.total}/100000 <b>${((config_JSON.CF.Usage.total / 100000) * 100).toFixed(2)}%</b>\n` : ''}`;
1252+
`${config_JSON.CF.Usage.success ? `📊 <b>请求用量:</b>${config_JSON.CF.Usage.total}/${config_JSON.CF.Usage.max} <b>${((config_JSON.CF.Usage.total / config_JSON.CF.Usage.max) * 100).toFixed(2)}%</b>\n` : ''}`;
12531253

12541254
const url = `https://api.telegram.org/bot${BotToken}/sendMessage?chat_id=${ChatID}&parse_mode=HTML&text=${encodeURIComponent(msg)}`;
12551255
return fetch(url, {

0 commit comments

Comments
 (0)