Fix and add simple telegram sending.
This commit is contained in:
4
api1.py
4
api1.py
@@ -6,6 +6,7 @@ from datetime import datetime,timedelta,timezone
|
||||
import sqlite3
|
||||
import smtplib
|
||||
from telethon.sync import TelegramClient
|
||||
import asyncio
|
||||
|
||||
# testing:
|
||||
# start dummy web server for dev with root: python3 -m smtpd -c DebuggingServer -n localhost:25
|
||||
@@ -74,10 +75,11 @@ def sendMail(topic,toAddr):
|
||||
https://deadswitch.kawomi.com/api/v1?topic={topic}
|
||||
|
||||
"""
|
||||
#sendSelfTelegram(message)
|
||||
sendSelfTelegram(message)
|
||||
server.sendmail(sender_email, receiver_email, message)
|
||||
|
||||
def expiryCheck():
|
||||
asyncio.set_event_loop(asyncio.SelectorEventLoop())
|
||||
print('.',end='')
|
||||
db=sqlite3.connect(DATABASE,detect_types=sqlite3.PARSE_DECLTYPES)
|
||||
cursor = db.cursor()
|
||||
|
||||
Reference in New Issue
Block a user