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")