add some doc
This commit is contained in:
parent
1b48ff1e79
commit
51fc3fb486
@ -6,12 +6,13 @@ TELEGRAM_TOKEN_ID = '1456847960:AAHF6ZVfPrPedN07-Z0FlbtFzuUgpQM3iO4' # token-id
|
|||||||
TELEGRAM_CHAT_ID = '291512617' # chat-id
|
TELEGRAM_CHAT_ID = '291512617' # chat-id
|
||||||
# ----------------
|
# ----------------
|
||||||
|
|
||||||
# using https://github.com/gvalvano/telegram-notification
|
|
||||||
def send_notifaction(timestamp):
|
def send_notification(timestamp):
|
||||||
# - - - - - - - - - -
|
""" sends Telegram notification
|
||||||
# Telegram notification:
|
using https://github.com/gvalvano/telegram-notification
|
||||||
|
"""
|
||||||
formatted_timestamp = timestamp.strftime("%d.%m.%Y, %H:%M:%S")
|
formatted_timestamp = timestamp.strftime("%d.%m.%Y, %H:%M:%S")
|
||||||
msg = "<b>Es hat geklingelt </b> \nTimestamp: {}".format(formatted_timestamp)
|
msg = "<b>Es hat geklingelt! </b> \nTimestamp: {}".format(formatted_timestamp)
|
||||||
telegram_notifier.basic_notifier(logger_name='training_notifier',
|
telegram_notifier.basic_notifier(logger_name='training_notifier',
|
||||||
token_id=TELEGRAM_TOKEN_ID,
|
token_id=TELEGRAM_TOKEN_ID,
|
||||||
chat_id=TELEGRAM_CHAT_ID,
|
chat_id=TELEGRAM_CHAT_ID,
|
||||||
|
@ -4,11 +4,13 @@ import unittest
|
|||||||
import telegram_bot
|
import telegram_bot
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
class TestGetDataFromRKI(unittest.TestCase):
|
|
||||||
|
class SendTestMessageToSwaghausenBot(unittest.TestCase):
|
||||||
|
|
||||||
def test_send_notifaction(self):
|
def test_send_notifaction(self):
|
||||||
timestamp = datetime.datetime.now()
|
timestamp = datetime.datetime.now()
|
||||||
telegram_bot.send_notifaction(timestamp)
|
telegram_bot.send_notification(timestamp)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user