更换 Telegram Bot 为新账号 polyyuanbot,更新群链接和推送配置
- Bot token/用户名全局替换:WeatherQuant_bot → polyyuanbot - 群 ID 更新为新群 polyweather售后群(-1003927451869) - 群邀请链接更新为 https://t.me/+Io5H9oVHFmVjOTQ5 - 修复机场推送:Paris/Taipei/Denver/Tel Aviv 支持 airport_primary/current 回退 - 修复跑道数据展示:has_runway 直接检测数据而非依赖 source 字段 - 创建新群 30 城 Forum Topics(data/city_thread_ids.json) - 配置 AMSC AWOS 数据源 URL Constraint: 旧 Telegram 账号已注销,Bot 完全重建 Tested: VPS 部署验证,所有城市推送正常,Topic 路由生效
This commit is contained in:
@@ -93,7 +93,7 @@ POLYWEATHER_OPS_ADMIN_EMAILS=yhrsc30@gmail.com
|
||||
|
||||
```env
|
||||
NEXT_PUBLIC_TELEGRAM_GROUP_URL=https://t.me/<your_group>
|
||||
NEXT_PUBLIC_TELEGRAM_BOT_URL=https://t.me/WeatherQuant_bot
|
||||
NEXT_PUBLIC_TELEGRAM_BOT_URL=https://t.me/polyyuanbot
|
||||
```
|
||||
|
||||
只影响按钮跳转,不影响核心页面加载。
|
||||
|
||||
@@ -39,5 +39,5 @@ NEXT_PUBLIC_WALLETCONNECT_POLYGON_RPC_URL=https://polygon-bor-rpc.publicnode.com
|
||||
NEXT_PUBLIC_PAYMENT_ALLOWED_HOSTS=polyweather-pro.vercel.app
|
||||
POLYWEATHER_OPS_ADMIN_EMAILS=yhrsc30@gmail.com
|
||||
NEXT_PUBLIC_TELEGRAM_GROUP_URL=https://t.me/your_group
|
||||
NEXT_PUBLIC_TELEGRAM_BOT_URL=https://t.me/WeatherQuant_bot
|
||||
NEXT_PUBLIC_TELEGRAM_LOGIN_BOT_USERNAME=WeatherQuant_bot
|
||||
NEXT_PUBLIC_TELEGRAM_BOT_URL=https://t.me/polyyuanbot
|
||||
NEXT_PUBLIC_TELEGRAM_LOGIN_BOT_USERNAME=polyyuanbot
|
||||
|
||||
+2
-2
@@ -39,5 +39,5 @@ NEXT_PUBLIC_WALLETCONNECT_POLYGON_RPC_URL=https://polygon-bor-rpc.publicnode.com
|
||||
NEXT_PUBLIC_PAYMENT_ALLOWED_HOSTS=polyweather-pro.vercel.app
|
||||
POLYWEATHER_OPS_ADMIN_EMAILS=yhrsc30@gmail.com
|
||||
NEXT_PUBLIC_TELEGRAM_GROUP_URL=https://t.me/your_group
|
||||
NEXT_PUBLIC_TELEGRAM_BOT_URL=https://t.me/WeatherQuant_bot
|
||||
NEXT_PUBLIC_TELEGRAM_LOGIN_BOT_USERNAME=WeatherQuant_bot
|
||||
NEXT_PUBLIC_TELEGRAM_BOT_URL=https://t.me/polyyuanbot
|
||||
NEXT_PUBLIC_TELEGRAM_LOGIN_BOT_USERNAME=polyyuanbot
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ POLYWEATHER_OPS_ADMIN_EMAILS=yhrsc30@gmail.com
|
||||
|
||||
# 社群入口
|
||||
NEXT_PUBLIC_TELEGRAM_GROUP_URL=https://t.me/<your_group>
|
||||
NEXT_PUBLIC_TELEGRAM_BOT_URL=https://t.me/WeatherQuant_bot
|
||||
NEXT_PUBLIC_TELEGRAM_BOT_URL=https://t.me/polyyuanbot
|
||||
|
||||
# 推荐默认关闭的前端观测 / 预热开关
|
||||
NEXT_PUBLIC_POLYWEATHER_APP_ANALYTICS=false
|
||||
|
||||
@@ -14,7 +14,7 @@ import { useI18n } from "@/hooks/useI18n";
|
||||
|
||||
const TELEGRAM_GROUP_URL = String(
|
||||
process.env.NEXT_PUBLIC_TELEGRAM_GROUP_URL ||
|
||||
"https://t.me/+nMG7SjziUKYyZmM1",
|
||||
"https://t.me/+Io5H9oVHFmVjOTQ5",
|
||||
).trim();
|
||||
|
||||
const FAQ_ITEMS = [
|
||||
|
||||
@@ -42,14 +42,14 @@ export function createAccountCopy(isEn: boolean): Record<string, string> {
|
||||
? "Use one-click Telegram binding first to sync notifications and access. After binding, refresh this page and submit your Telegram group join request."
|
||||
: "优先使用「一键绑定 Telegram Bot」同步通知与权限。绑定完成后刷新本页,再提交 Telegram 群组入群申请。",
|
||||
telegramFallbackHint: isEn
|
||||
? "Fallback copy method: only use this if one-click binding does not open Telegram correctly. Copy the command below and send it to @WeatherQuant_bot. After binding, refresh this page to show the group entry."
|
||||
: "兜底复制方式:仅在一键绑定无法正常打开 Telegram 时使用。请复制下方命令并发送给 @WeatherQuant_bot。绑定完成后刷新本页,即可显示入群入口。",
|
||||
? "Fallback copy method: only use this if one-click binding does not open Telegram correctly. Copy the command below and send it to @polyyuanbot. After binding, refresh this page to show the group entry."
|
||||
: "兜底复制方式:仅在一键绑定无法正常打开 Telegram 时使用。请复制下方命令并发送给 @polyyuanbot。绑定完成后刷新本页,即可显示入群入口。",
|
||||
paymentManualSupport: isEn
|
||||
? "If payment succeeds but Pro is still not activated, email yhrsc30@gmail.com. This project is currently maintained by one developer, so manual recovery may be needed in edge cases."
|
||||
: "如果付款成功后 Pro 仍未开通,请发邮件到 yhrsc30@gmail.com。当前项目由我一人维护,极少数边缘情况可能需要人工补开。给你带来的不便,敬请谅解!",
|
||||
telegramBotLink: isEn
|
||||
? "Open Bot (@WeatherQuant_bot)"
|
||||
: "打开机器人 (@WeatherQuant_bot)",
|
||||
? "Open Bot (@polyyuanbot)"
|
||||
: "打开机器人 (@polyyuanbot)",
|
||||
telegramBotBindLink: isEn ? "One-click Telegram Binding" : "一键绑定 Telegram Bot",
|
||||
telegramGroupLink: isEn ? "Join Telegram Group" : "加入 Telegram 群组",
|
||||
telegramTopicsGroupLink: isEn
|
||||
|
||||
@@ -5,9 +5,9 @@ export const WALLETCONNECT_POLYGON_RPC_URL = String(
|
||||
process.env.NEXT_PUBLIC_WALLETCONNECT_POLYGON_RPC_URL ||
|
||||
"https://polygon-bor-rpc.publicnode.com",
|
||||
).trim();
|
||||
export const TELEGRAM_GROUP_URL = "https://t.me/+Se93RpNQ58FhYmZh";
|
||||
export const TELEGRAM_GROUP_URL = "https://t.me/+Io5H9oVHFmVjOTQ5";
|
||||
export const TELEGRAM_BOT_URL = String(
|
||||
process.env.NEXT_PUBLIC_TELEGRAM_BOT_URL || "https://t.me/WeatherQuant_bot",
|
||||
process.env.NEXT_PUBLIC_TELEGRAM_BOT_URL || "https://t.me/polyyuanbot",
|
||||
).trim();
|
||||
export const TELEGRAM_TOPICS_GROUP_URL = TELEGRAM_GROUP_URL;
|
||||
export const SUBSCRIPTION_HELP_HREF = "/subscription-help";
|
||||
|
||||
@@ -9,7 +9,7 @@ import { trackAppEvent } from "@/lib/app-analytics";
|
||||
|
||||
const TELEGRAM_GROUP_URL = String(
|
||||
process.env.NEXT_PUBLIC_TELEGRAM_GROUP_URL ||
|
||||
"https://t.me/+nMG7SjziUKYyZmM1",
|
||||
"https://t.me/+Io5H9oVHFmVjOTQ5",
|
||||
).trim();
|
||||
const SUBSCRIPTION_HELP_HREF = "/subscription-help";
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
import s from "./UnlockProOverlay.module.css";
|
||||
|
||||
const DEFAULT_FAQ_HREF = "/subscription-help";
|
||||
const DEFAULT_TELEGRAM_GROUP_URL = "https://t.me/+nMG7SjziUKYyZmM1";
|
||||
const DEFAULT_TELEGRAM_GROUP_URL = "https://t.me/+Io5H9oVHFmVjOTQ5";
|
||||
|
||||
export type UnlockProBilling = {
|
||||
pointsEnabled: boolean;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
Stack trace:
|
||||
Frame Function Args
|
||||
000FFFFBCA0 00180062F57 (000FFFFBEA8, 00000000002, 00000000002, 000FFFFDE50)
|
||||
00000000000 00180065045 (00000000064, 00000000000, 00000000188, 00000000000)
|
||||
000FFFFC3B0 001801369F8 (00000000000, 00000000000, 00000000000, 00000000000)
|
||||
000000000C1 0018013202B (00000000000, 00000000000, 00000000000, 000007E39A0)
|
||||
000FFFFC7D0 00180132435 (00000000000, 00800000000, 000000000B5, 00100437000)
|
||||
000FFFFC7D0 001802195E8 (00000000000, 00800000030, 00000000000, 00000000000)
|
||||
000FFFFC7D0 00100429F25 (001800DB6FE, 0007FFE0358, 7FFEDD6B00F3, 000002432EE)
|
||||
000FFFFC840 00100404B11 (0000000003F, 00000000040, 00000000040, 00000000000)
|
||||
000FFFFCA30 001004294B0 (000FFFFCBD0, 00180235040, 00000000000, 04EC36FD370)
|
||||
000FFFFCD30 00180049B91 (00000000000, 00000000000, 00000000000, 00000000000)
|
||||
000FFFFFFF0 00180047716 (00000000000, 00000000000, 00000000000, 00000000000)
|
||||
000FFFFFFF0 001800477C4 (00000000000, 00000000000, 00000000000, 00000000000)
|
||||
End of stack trace
|
||||
@@ -38,7 +38,7 @@ def _load_env() -> None:
|
||||
|
||||
_load_env()
|
||||
BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN", "").strip()
|
||||
CHAT_ID = -1003965137823
|
||||
CHAT_ID = -1003927451869
|
||||
|
||||
CITIES: list[tuple[str, str]] = [
|
||||
("🇨🇳 Beijing", "beijing"),
|
||||
|
||||
@@ -25,7 +25,7 @@ def _load_env() -> None:
|
||||
|
||||
_load_env()
|
||||
TOKEN = os.getenv("TELEGRAM_BOT_TOKEN", "").strip()
|
||||
CHAT_ID = -1003965137823
|
||||
CHAT_ID = -1003927451869
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2:
|
||||
|
||||
@@ -27,7 +27,7 @@ def _load_env() -> None:
|
||||
|
||||
_load_env()
|
||||
TOKEN = os.getenv("TELEGRAM_BOT_TOKEN", "").strip()
|
||||
CHAT_ID = -1003965137823
|
||||
CHAT_ID = -1003927451869
|
||||
|
||||
|
||||
def _try_get_topic(tid: int) -> dict | None:
|
||||
|
||||
+2
-2
@@ -203,8 +203,8 @@ class BotIOLayer:
|
||||
"/diag - 查看 Bot 启动诊断\n\n"
|
||||
"/bind - 绑定 Supabase 账号(可选)\n"
|
||||
"/unbind - 解除当前 Telegram 与网页账号绑定\n\n"
|
||||
"🔗 机器人: <a href=\"https://t.me/WeatherQuant_bot\">@WeatherQuant_bot</a>\n"
|
||||
"👥 社群: <a href=\"https://t.me/+nMG7SjziUKYyZmM1\">加入 Telegram 群组</a>\n\n"
|
||||
"🔗 机器人: <a href=\"https://t.me/polyyuanbot\">@polyyuanbot</a>\n"
|
||||
"👥 社群: <a href=\"https://t.me/+Io5H9oVHFmVjOTQ5\">加入 Telegram 群组</a>\n\n"
|
||||
"📌 <i>私有频道用于接收自动推送;手动查看市场概览请私聊机器人发送 <code>/markets</code>。</i>\n\n"
|
||||
"🔐 <i>/city 与 /deb 仅限官方群成员使用。</i>\n\n"
|
||||
"示例: <code>/city 伦敦</code> 或 <code>/pwcity 伦敦</code>\n"
|
||||
|
||||
@@ -33,7 +33,7 @@ TARGET_CITIES: List[str] = [
|
||||
"qingdao",
|
||||
]
|
||||
|
||||
FORUM_CHAT_ID = "-1003965137823"
|
||||
FORUM_CHAT_ID = "-1003927451869"
|
||||
|
||||
CITY_NAME_ZH: Dict[str, str] = {
|
||||
"beijing": "北京",
|
||||
|
||||
@@ -25,7 +25,7 @@ _CITY_THREAD_IDS_PATH = os.path.join(
|
||||
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
|
||||
"data", "city_thread_ids.json",
|
||||
)
|
||||
_FORUM_CHAT_ID = "-1003965137823"
|
||||
_FORUM_CHAT_ID = "-1003927451869"
|
||||
_city_thread_ids: dict = {}
|
||||
|
||||
|
||||
@@ -917,12 +917,12 @@ def _build_airport_status_message(
|
||||
time_suffix = f" · {local_time}" if local_time else ""
|
||||
|
||||
amos = city_weather.get("amos") or {}
|
||||
runway_data = (amos.get("runway_obs") or {}) if amos else {}
|
||||
runway_data = amos.get("runway_obs") or {}
|
||||
runway_pairs = runway_data.get("runway_pairs") or []
|
||||
runway_temps = runway_data.get("temperatures") or []
|
||||
point_temps = runway_data.get("point_temperatures") or []
|
||||
is_amsc = amos.get("source") in ("amsc_awos", "amos")
|
||||
has_runway = bool(is_amsc and (point_temps or runway_temps))
|
||||
has_runway = bool(runway_pairs and (runway_temps or point_temps))
|
||||
amos_icao = amos.get("icao") or HIGH_FREQ_AIRPORT_ICAO.get(city, "")
|
||||
settlement_pair = _settlement_runway_for_city(city)
|
||||
|
||||
@@ -1213,11 +1213,20 @@ def _process_airport_city(
|
||||
airport_row = row
|
||||
break
|
||||
if not airport_row:
|
||||
logger.warning(
|
||||
"airport push skipped city={}: station {} not found in mgm_nearby ({} rows)",
|
||||
city, airport_icao, len(mgm_nearby),
|
||||
)
|
||||
return None
|
||||
airport_primary = city_weather.get("airport_primary") or {}
|
||||
if airport_primary.get("temp") is not None:
|
||||
airport_row = airport_primary
|
||||
else:
|
||||
current_fallback = city_weather.get("current") or {}
|
||||
if current_fallback.get("temp") is not None:
|
||||
airport_row = current_fallback
|
||||
else:
|
||||
logger.warning(
|
||||
"airport push skipped city={}: station {} not found in mgm_nearby, "
|
||||
"airport_primary, or current (mgm={} rows)",
|
||||
city, airport_icao, len(mgm_nearby),
|
||||
)
|
||||
return None
|
||||
station_temp = airport_row.get("temp") if airport_row else None
|
||||
current_obs_time = str(airport_row.get("obs_time") or "")
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ def create_telegram_bot_bind_link(request: Request) -> Dict[str, Any]:
|
||||
bot_username = str(
|
||||
legacy_routes.os.getenv("TELEGRAM_BOT_USERNAME")
|
||||
or legacy_routes.os.getenv("NEXT_PUBLIC_TELEGRAM_BOT_USERNAME")
|
||||
or "WeatherQuant_bot"
|
||||
or "polyyuanbot"
|
||||
).strip().lstrip("@")
|
||||
bot_url = f"https://t.me/{bot_username}?start={start_param}"
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user