This repo is spacialy made for offical MLTB
I am not good at editing README file
cp sample.env .env
BOT_TOKEN
: You guys know how to get it
STATUS_UPDATE_INTERVAL
: Message update intervel timeTIME_ZONE
: Timezone google itHEADER_MSG
: A message for header side (you can use html)FOOTER_MSG
: A message for footer side (you can use html)CONFIG_JSON_URL
: To download the config.json it will orverwrite the existing oneCONFIG_ENV_URL
: To download the .env it will orverwrite the existing one
Config.json Json
cp config-sample.json config.json
{
"bots": {
"bot1": {
"base_url_of_bot": "http://0.0.0.0",
"host": "Heroku/Whatever",
"bot_uname": "@botfather"
},
"bot2": {
"base_url_of_bot": "http://0.0.0.0",
"host": "Vps",
"bot_uname": "@botfather"
}
},
"channels": {
"chat1": {
"chat_id": "-100987654321",
"message_id": "54321"
},
"chat2": {
"chat_id": "-100123456789",
"message_id": "12345"
}
}
}
(You can add upto 18 bots this will work slowly)
bot1
: it could be anything but it should unique name ex:bot1
,bot2
base_url_of_bot
: Read it from herehost
: it could be anythingbot_uname
: Bot username it will show on top of status
chat1
: same asbot1
chat_id
: Channel id or you can try add channel usernamemessage_id
: Message id which message you want updatehttps://t.me/JMDKH_Team/153
this153
is message id
bash sendMsg.sh -100123456789 123456:abcdefg
This Script will send a message in group from the bot then you can get message id from it
Add few require imports Here
from time import sleep, time
from psutil import boot_time, disk_usage, net_io_counters
from subprocess import check_output
from os import path as ospath
Add This Code Above This Line
if ospath.exists('.git'):
commit_date = check_output(["git log -1 --date=format:'%y/%m/%d %H:%M' --pretty=format:'%cd'"], shell=True).decode()
else:
commit_date = 'No UPSTREAM_REPO'
@app.route('/status', methods=['GET'])
def status():
uptime = time() - boot_time()
sent = net_io_counters().bytes_sent
recv = net_io_counters().bytes_recv
return {
'commit_date': commit_date,
'uptime': uptime,
'free_disk': disk_usage('.').free,
'total_disk': disk_usage('.').total,
'network': {
'sent': sent,
'recv': recv,
},
}