MCPcopy Create free account
hub / github.com/cppla/ServerStatus / _send

Function _send

plugin/bot-telegram.py:19–26  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

17counterOn = {}
18
19def _send(text):
20 chat_id = os.getenv('TG_CHAT_ID')
21 bot_token = os.environ.get('TG_BOT_TOKEN')
22 url = f"https://api.telegram.org/bot{bot_token}/sendMessage?parse_mode=HTML&disable_web_page_preview=true&chat_id=" + chat_id + "&text=" + text
23 try:
24 requests.get(url)
25 except Exception as e:
26 print("catch exception: ", traceback.format_exc())
27
28def send2tg(srv, flag):
29 if srv not in counterOff:

Callers 1

send2tgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected