📌 📄 内容摘要:
Xiang (@xjfkkk) 在 cloudflare反代TG 中发帖
适用于无法请求TG消息的情况
worker
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
// 确保请求方法是 POST
if (request.method !== 'POST') {
return new Response('Only POST requests are allowed', { status: 405 })
}
// 从请求 URL 中提取 bot token 和方法
const url = new URL(request.url)
const pathParts = url.pathname.split('/')
...
────────── 链接信息 ────────── 🔗 论坛链接: linux.do 📎 访问地址: https://linux.do/t/topic/249711/1 ─────────────────────────────
📢 来源:LINUX DO