Sat Jun 22 10:45:16 PM CEST 2024
This commit is contained in:
parent
23ae2bbfb2
commit
ca94b6299b
|
@ -1,18 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
import telegram
|
||||
import fileinput
|
||||
import asyncio
|
||||
|
||||
async def run():
|
||||
text = "Vault Etienne:\n\n"
|
||||
for line in fileinput.input():
|
||||
text += line
|
||||
|
||||
bot = telegram.Bot(token="381718873:AAElFmI2BDjumCehhWicuksE0vutrPSkoGA")
|
||||
chat_id = 125754925
|
||||
await bot.send_message(chat_id, text)
|
||||
|
||||
if __name__ == "__main__":
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(asyncio.wait([loop.create_task(run())]))
|
||||
loop.close()
|
|
@ -8,6 +8,7 @@ let
|
|||
import asyncio
|
||||
import sys
|
||||
import socket
|
||||
import json
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
|
@ -25,12 +26,16 @@ let
|
|||
]
|
||||
).decode("utf-8")
|
||||
|
||||
with open("/home/server/.secrets/Telegram/token.json") as f:
|
||||
credentials = json.load(f)
|
||||
token = credentials["token"]
|
||||
chat_id = credentials["chat_id"]
|
||||
|
||||
with open("/home/server/mail.log", "a") as f:
|
||||
f.write(text)
|
||||
f.write("\n===========================================\n")
|
||||
|
||||
bot = telegram.Bot(token="381718873:AAElFmI2BDjumCehhWicuksE0vutrPSkoGA")
|
||||
chat_id = 125754925
|
||||
bot = telegram.Bot(token=token)
|
||||
hostname = socket.gethostname()
|
||||
await bot.send_message(
|
||||
chat_id,
|
||||
|
|
Loading…
Reference in New Issue