hotfix #2
This commit is contained in:
parent
5d0ce49d0c
commit
f45bffd25e
1 changed files with 6 additions and 2 deletions
|
|
@ -5,11 +5,13 @@
|
||||||
import subprocess
|
import subprocess
|
||||||
import threading
|
import threading
|
||||||
import telebot
|
import telebot
|
||||||
|
import os
|
||||||
|
|
||||||
#define the variables
|
#define the variables
|
||||||
status, hostname, uptime, zerotier, prosody, postgres, tailscale, disk, ping = 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown'
|
status, hostname, uptime, zerotier, prosody, postgres, tailscale, disk, ping = 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown'
|
||||||
nodes, hostnames, reach, threads = [], [], [], []
|
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 init
|
||||||
bot = telebot.TeleBot(TOKEN)
|
bot = telebot.TeleBot(TOKEN)
|
||||||
|
|
@ -89,6 +91,8 @@ def handle(message):
|
||||||
ping_status = '\n'.join(reach)
|
ping_status = '\n'.join(reach)
|
||||||
bot.reply_to(message, f'ping status:\n\n{ping_status}')
|
bot.reply_to(message, f'ping status:\n\n{ping_status}')
|
||||||
ping_status = ''
|
ping_status = ''
|
||||||
|
global reach
|
||||||
|
reach.clear()
|
||||||
|
|
||||||
#polling
|
#polling
|
||||||
bot.polling()
|
bot.polling()
|
||||||
Loading…
Add table
Reference in a new issue