Fix and add simple telegram sending.

This commit is contained in:
Joe Tretter
2022-01-12 19:46:05 -06:00
parent dcfb6a2892
commit a583d89172
3 changed files with 4 additions and 1 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
/deadswitch.sqlite3
__pycache__

View File

@@ -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()

Binary file not shown.