File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525ql repo https://github.com/Cp0204/ChinaTelecomMonitor.git "telecom_monitor" "" "telecom_class|notify"
2626```
2727
28- | 环境变量 | 示例 | 备注 |
29- | -------------- | --------------------- | ------------------------------ |
30- | ` TELECOM_USER ` | ` 18912345678password ` | 手机号密码直接拼接,会自动截取 |
28+ | 环境变量 | 示例 | 备注 |
29+ | ---------------------- | --------------------- | ----------------------------------------------- |
30+ | ` TELECOM_USER ` | ` 18912345678password ` | 手机号密码直接拼接,密码应为6位数字,会自动截取 |
31+ | ` TELECOM_FLUX_PACKAGE ` | ` true ` (默认) | 推送流量包明细,` false ` 则只推送基本信息 |
3132
3233### Docker API 服务
3334
Original file line number Diff line number Diff line change @@ -176,22 +176,22 @@ def auto_login():
176176 if summary ["specialTotal" ] > 0
177177 else ""
178178 )
179- # 添加通知
180- add_notify (
181- f"""
179+
180+ # 基本信息
181+ notify_str = f"""
182182📱 手机:{ summary ['phonenum' ]}
183183💰 余额:{ round (summary ['balance' ]/ 100 ,2 )}
184- 📞 通话:{ summary ['voiceUsage' ]} { f" / { summary ['voiceTotal' ]} " if summary ['voiceTotal' ]> 0 else "" } min
184+ 📞 通话:{ summary ['voiceUsage' ]} { f' / { summary ['voiceTotal' ]} ' if summary ['voiceTotal' ]> 0 else '' } min
185185🌐 总流量
186- - 通用:{ common_str } { f" { chr (10 )} - 专用:{ special_str } " if special_str else "" }
186+ - 通用:{ common_str } { f' { chr (10 )} - 专用:{ special_str } ' if special_str else '' } """
187187
188- 【流量包明细】
188+ # 流量包明细
189+ if os .environ .get ("TELECOM_FLUX_PACKAGE" , "true" ).lower () != "false" :
190+ notify_str += f"\n \n 【流量包明细】\n \n { flux_package_str .strip ()} "
189191
190- { flux_package_str . strip () }
192+ notify_str += f" \n \n 查询时间: { summary [ 'createTime' ] } "
191193
192- 查询时间:{ summary ['createTime' ]}
193- """ .strip ()
194- )
194+ add_notify (notify_str .strip ())
195195
196196 # 通知
197197 if NOTIFYS :
You can’t perform that action at this time.
0 commit comments