This commit is contained in:
HornetMaidan 2024-10-05 01:24:00 +05:00
parent 5d0ce49d0c
commit f45bffd25e

View file

@ -5,11 +5,13 @@
import subprocess
import threading
import telebot
import os
#define the variables
status, hostname, uptime, zerotier, prosody, postgres, tailscale, disk, ping = 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown'
nodes, hostnames, reach, threads = [], [], [], []
#telegram bot token
TOKEN = 'PLACE_YOUR_TOKEN_HERE'
TOKEN = os.getenv('TELEGRAM_BOT_TOKEN') #telegram bot token - set it in env: $TELEGRAM_BOT_TOKEN=your_token_here
#bot init
bot = telebot.TeleBot(TOKEN)
@ -89,6 +91,8 @@ def handle(message):
ping_status = '\n'.join(reach)
bot.reply_to(message, f'ping status:\n\n{ping_status}')
ping_status = ''
global reach
reach.clear()
#polling
bot.polling()