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