Files
blog/tmp_fixth2.py
T

13 lines
537 B
Python
Raw Normal View History

2026-06-01 17:57:22 +08:00
path = r"E:\GitHub\blog\bot-go\internal\tghandlers\tghandlers.go"
with open(path, "rb") as f:
content = f.read().decode("utf-8")
# Replace helpers.GetLanIP -> tgcore.getLanIP (or just inline)
# Replace helpers.CheckPort -> tgcore.checkPort
content = content.replace("helpers.GetLanIP", "tgcore.GetLanIP")
content = content.replace("helpers.CheckPort", "tgcore.CheckPort")
content = content.replace("helpers.", "tgcore.")
with open(path, "wb") as f:
f.write(content.encode("utf-8"))
print("Fixed helpers refs in tghandlers")