init
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import telegram
|
import telegram
|
||||||
|
import asyncio
|
||||||
from multiprocessing import Pool
|
from multiprocessing import Pool
|
||||||
|
|
||||||
class TelegramBot:
|
class TelegramBot:
|
||||||
@@ -35,9 +36,9 @@ class TelegramBot:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def send(text):
|
def send(text):
|
||||||
client = telegram.Bot(token="6435061393:AAHOh9wB5yGNGUdb3SfCYJrrWTBe7wgConM")
|
client = telegram.Bot(token="6874078562:AAEHxGDavfc0ssAXPQIaW8JGYmTR7LNUJOw")
|
||||||
#client.sendMessage(chat_id='574661323', text=text)
|
#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
|
return
|
||||||
|
|
||||||
def alarm_live(self, stock_code, stock_name):
|
def alarm_live(self, stock_code, stock_name):
|
||||||
@@ -80,3 +81,5 @@ if __name__ == "__main__":
|
|||||||
telegramBot = TelegramBot()
|
telegramBot = TelegramBot()
|
||||||
telegramBot.alarm_live(stock_code, stock_name)
|
telegramBot.alarm_live(stock_code, stock_name)
|
||||||
telegramBot.post(stock_code, stock_name, type, price, count)
|
telegramBot.post(stock_code, stock_name, type, price, count)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user