秋雪通知是一个专注于分享最新秋季和冬季雪景的Telegram频道。无论是追求雪景的摄影师,还是喜欢在雪中漫步的旅行者,这里都是您的最佳去处。在秋雪通知频道上,您将看到全球各地最美丽的雪景照片和视频,了解最新的滑雪胜地推荐,以及获取关于雪季旅行的实用建议。不仅如此,我们还定期更新关于近期雪灾和交通阻塞的通知,确保您安全的享受冬季的乐趣。无论您是热爱雪的人,还是只是享受美丽景色的人,秋雪通知都能满足您的需求。赶快加入我们的频道,与全球的雪景爱好者一起分享您的照片和故事吧!
09 Jan, 13:56
25 Dec, 13:33
25 Dec, 08:10
25 Dec, 08:10
29 Nov, 07:36
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
const API_TOKEN = '机器人token@botfather获取'
const channels = [-1001285658397, -1001682213840, -1001950384240, -1002196738831,-1001814462831,-1002227231255,-1001845544423]
async function userInChannels(userId, channels) {
for (let channel of channels) {
const url = `https://api.telegram.org/bot${API_TOKEN}/getChatMember?chat_id=${channel}&user_id=${userId}`
const response = await fetch(url)
const data = await response.json()
if (data.ok) {
const status = data.result.status
if (!['member', 'administrator', 'creator'].includes(status)) {
return false
}
} else {
return false
}
}
return true
}
async function handleRequest(request) {
const url = new URL(request.url)
const pathname = url.pathname
const params = new URLSearchParams(url.search)
if (pathname === '/webhook') {
const body = await request.json()
const message = body.message
const chatId = message.chat.id
const userId = message.from.id
const command = message.text.trim().toLowerCase()
if (command === "/start") {
const inChannels = await userInChannels(userId, channels)
if (inChannels) {
return sendTelegramMessage(chatId, "成功发送的消息")
} else {
return sendTelegramMessage(chatId, "失败发送的消息")
}
}
}
return new Response('OK')
}
async function sendTelegramMessage(chatId, text) {
const url = `https://api.telegram.org/bot${API_TOKEN}/sendMessage`
const body = JSON.stringify({ chat_id: chatId, text: text })
await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: body
})
return new Response('Message sent')
}
07 Nov, 14:47
04 Nov, 11:38
秋雪公益直装TG频道@QXZZ666
登录自瞄版秋雪公益直装TG频道@QXZZ666
登录