From d81456ff77d76509cbd137be86a4ed4c6abf9427 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Fri, 27 Oct 2023 14:27:28 +0900 Subject: [PATCH] init --- stock/util/TelegramBot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stock/util/TelegramBot.py b/stock/util/TelegramBot.py index 69cdc59..678527f 100644 --- a/stock/util/TelegramBot.py +++ b/stock/util/TelegramBot.py @@ -1,5 +1,6 @@ from datetime import datetime import telegram +import asyncio from multiprocessing import Pool class TelegramBot: @@ -35,9 +36,9 @@ class TelegramBot: @staticmethod def send(text): - client = telegram.Bot(token="6435061393:AAHOh9wB5yGNGUdb3SfCYJrrWTBe7wgConM") + client = telegram.Bot(token="6874078562:AAEHxGDavfc0ssAXPQIaW8JGYmTR7LNUJOw") #client.sendMessage(chat_id='574661323', text=text) - client.send_message(chat_id='574661323', text=text) + asyncio.run(client.send_message(chat_id='574661323', text=text)) return def alarm_live(self, stock_code, stock_name): @@ -80,3 +81,5 @@ if __name__ == "__main__": telegramBot = TelegramBot() telegramBot.alarm_live(stock_code, stock_name) telegramBot.post(stock_code, stock_name, type, price, count) + +