Merge pull request #86 from WebEngineering2/bot

Bot to isin
This commit is contained in:
NormalParameter 2022-04-26 09:37:07 +02:00 committed by GitHub
commit 005f350c95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -250,9 +250,9 @@ def update_for_user(message):
my_portfolio = p_my_handler.get_user_portfolio(p_user_id) my_portfolio = p_my_handler.get_user_portfolio(p_user_id)
for element in my_portfolio: for element in my_portfolio:
if element["count"] != '' and element["symbol"]!= '': if element["count"] != '' and element["isin"]!= '':
print(element["count"], element["symbol"]) print(element["count"], element["isin"])
share_symbols.append(element["symbol"]) share_symbols.append(element["isin"])
share_amounts.append(element["count"]) share_amounts.append(element["count"])
share_courses.append(element["current_price"]) share_courses.append(element["current_price"])
@ -267,7 +267,7 @@ def update_for_user(message):
send_to_user("No shares found for your account. Check https://gruppe1.testsites.info to change your settings and add shares.", pUser_id=p_user_id) send_to_user("No shares found for your account. Check https://gruppe1.testsites.info to change your settings and add shares.", pUser_id=p_user_id)
def send_to_user(pText, pUser_id = 1770205310): def send_to_user(pText, pUser_id):
""" Send message to user """ Send message to user
:type pText: string :type pText: string

View File

@ -19,7 +19,6 @@ import sys
from multiprocessing import Process from multiprocessing import Process
from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.schedulers.background import BackgroundScheduler
from api_handling.api_handler import API_Handler from api_handling.api_handler import API_Handler
from news.news_fetcher import format_article
''' '''
@ -133,9 +132,9 @@ def update_for_user(p_user_id, p_my_handler):
my_portfolio = p_my_handler.get_user_portfolio(p_user_id) my_portfolio = p_my_handler.get_user_portfolio(p_user_id)
for element in my_portfolio: for element in my_portfolio:
if element["count"] != '' and element["symbol"]!= '': if element["count"] != '' and element["isin"]!= '':
print(element["count"], element["symbol"]) print(element["count"], element["isin"])
share_symbols.append(element["symbol"]) share_symbols.append(element["isin"])
share_amounts.append(element["count"]) share_amounts.append(element["count"])
share_courses.append(element["current_price"]) share_courses.append(element["current_price"])