Compare commits
7 Commits
dependabot
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
|
b919411809 | ||
|
594b532fe7 | ||
|
fb8922f06a | ||
|
aadfba74f0 | ||
|
e06c43b762 | ||
|
6586ac2bfe | ||
|
56bb9908d1 |
8
.github/dependabot.yml
vendored
8
.github/dependabot.yml
vendored
@@ -10,8 +10,6 @@ updates:
|
||||
directory: "/api"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
assignees:
|
||||
- "H4CK3R-01"
|
||||
open-pull-requests-limit: 100
|
||||
|
||||
# Bot
|
||||
@@ -19,10 +17,6 @@ updates:
|
||||
directory: "/telegram_bot"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
assignees:
|
||||
- "NormalParameter"
|
||||
- "Rripped"
|
||||
- "FlorianKellermann"
|
||||
open-pull-requests-limit: 100
|
||||
|
||||
# Frontend
|
||||
@@ -30,6 +24,4 @@ updates:
|
||||
directory: "/frontend"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
assignees:
|
||||
- "kevinpauer"
|
||||
open-pull-requests-limit: 100
|
||||
|
30
frontend/package-lock.json
generated
30
frontend/package-lock.json
generated
@@ -19,7 +19,7 @@
|
||||
"@angular/platform-browser-dynamic": "~13.2.0",
|
||||
"@angular/router": "~13.2.0",
|
||||
"bootstrap": "^5.1.3",
|
||||
"ngx-cron-editor": "^0.7.3",
|
||||
"ngx-cron-editor": "^0.7.4",
|
||||
"rxjs": "~7.5.0",
|
||||
"tslib": "^2.4.0",
|
||||
"zone.js": "~0.11.4"
|
||||
@@ -10033,21 +10033,21 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/ngx-cron-editor": {
|
||||
"version": "0.7.3",
|
||||
"resolved": "https://registry.npmjs.org/ngx-cron-editor/-/ngx-cron-editor-0.7.3.tgz",
|
||||
"integrity": "sha512-ICrikARGU5HJ9hZ8H4aGkKZP/T3U9Ym/2rIpS2wjimB3ASypp/8pAm6cEqaaJ5IHbSjgZBHEMeoomVkTa15l2g==",
|
||||
"version": "0.7.4",
|
||||
"resolved": "https://registry.npmjs.org/ngx-cron-editor/-/ngx-cron-editor-0.7.4.tgz",
|
||||
"integrity": "sha512-5kD5yxFK9tnOUwYwIO5kAsTnYW9oXdVbrSooU2966grbjvxbnaVvsgxQTMcZCIH6Q03dwWdjP2GA1gFXdmLkww==",
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/animations": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
|
||||
"@angular/common": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
|
||||
"@angular/core": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
|
||||
"@angular/forms": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
|
||||
"@angular/material": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
|
||||
"@angular/platform-browser": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
|
||||
"@angular/platform-browser-dynamic": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
|
||||
"@angular/router": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0"
|
||||
"@angular/animations": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
||||
"@angular/common": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
||||
"@angular/core": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
||||
"@angular/forms": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
||||
"@angular/material": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
||||
"@angular/platform-browser": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
||||
"@angular/platform-browser-dynamic": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
||||
"@angular/router": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nice-napi": {
|
||||
@@ -21208,9 +21208,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"ngx-cron-editor": {
|
||||
"version": "0.7.3",
|
||||
"resolved": "https://registry.npmjs.org/ngx-cron-editor/-/ngx-cron-editor-0.7.3.tgz",
|
||||
"integrity": "sha512-ICrikARGU5HJ9hZ8H4aGkKZP/T3U9Ym/2rIpS2wjimB3ASypp/8pAm6cEqaaJ5IHbSjgZBHEMeoomVkTa15l2g==",
|
||||
"version": "0.7.4",
|
||||
"resolved": "https://registry.npmjs.org/ngx-cron-editor/-/ngx-cron-editor-0.7.4.tgz",
|
||||
"integrity": "sha512-5kD5yxFK9tnOUwYwIO5kAsTnYW9oXdVbrSooU2966grbjvxbnaVvsgxQTMcZCIH6Q03dwWdjP2GA1gFXdmLkww==",
|
||||
"requires": {
|
||||
"tslib": "^2.0.0"
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@
|
||||
"@angular/platform-browser-dynamic": "~13.2.0",
|
||||
"@angular/router": "~13.2.0",
|
||||
"bootstrap": "^5.1.3",
|
||||
"ngx-cron-editor": "^0.7.3",
|
||||
"ngx-cron-editor": "^0.7.4",
|
||||
"rxjs": "~7.5.0",
|
||||
"tslib": "^2.4.0",
|
||||
"zone.js": "~0.11.4"
|
||||
|
@@ -208,7 +208,7 @@ def send_status(message):
|
||||
bot.reply_to(message, "bot is running")
|
||||
|
||||
|
||||
@bot.message_handler(commands=['portfolio', 'Portfolio']) # /update -> update shares
|
||||
@bot.message_handler(commands=['portfolio', 'Portfolio']) # /portfolio -> print all owned shares
|
||||
def update_for_user(message):
|
||||
p_user_id = int(message.from_user.id)
|
||||
p_my_handler = api_handler
|
||||
|
@@ -63,8 +63,13 @@ def update_crontab(p_my_handler):
|
||||
|
||||
global user_crontab
|
||||
global user_ids
|
||||
|
||||
all_users = p_my_handler.get_all_users() # get all users so crontabs can update for everybody
|
||||
|
||||
all_users = p_my_handler.get_all_users() # get all users so crontabs can update for everybody
|
||||
|
||||
if all_users == None:
|
||||
print("No users found, trying again.")
|
||||
update_crontab(p_my_handler)
|
||||
return
|
||||
|
||||
user_ids = []
|
||||
user_crontab = []
|
||||
@@ -75,10 +80,9 @@ def update_crontab(p_my_handler):
|
||||
user_ids.append(int(element["telegram_user_id"]))
|
||||
try:
|
||||
user_crontab.append(str(element["cron"]))
|
||||
except:
|
||||
user_ids.pop() # if something goes wrong with cron I have to delete matching user id
|
||||
except:
|
||||
continue
|
||||
except:
|
||||
user_ids.pop() # if something goes wrong with cron I have to delete matching user id
|
||||
except: continue
|
||||
|
||||
print(user_ids)
|
||||
|
||||
@@ -130,21 +134,23 @@ def update_for_user(p_user_id, p_my_handler):
|
||||
"""
|
||||
share_symbols = []
|
||||
share_amounts = []
|
||||
|
||||
my_portfolio = p_my_handler.get_user_portfolio(p_user_id) # get all existing shares for user
|
||||
|
||||
my_portfolio = p_my_handler.get_user_portfolio(p_user_id) # get all existing shares for user
|
||||
|
||||
for element in my_portfolio:
|
||||
if element["count"] != '' and element["isin"] != '':
|
||||
print(element["count"], element["isin"])
|
||||
share_symbols.append(element["isin"])
|
||||
share_amounts.append(element["count"])
|
||||
if my_portfolio!=None:
|
||||
for element in my_portfolio:
|
||||
if element["count"] != '' and element["isin"] != '':
|
||||
print(element["count"], element["isin"])
|
||||
share_symbols.append(element["isin"])
|
||||
share_amounts.append(element["count"])
|
||||
|
||||
my_user = p_my_handler.get_user(p_user_id)
|
||||
send_to_user("Hello %s this is your share update for today:" % str(my_user["username"]), pUser_id=p_user_id)
|
||||
send_to_user("Hello %s this is your update for today:"%str(my_user["username"]), pUser_id=p_user_id)
|
||||
|
||||
shares = p_my_handler.get_user_shares(p_user_id) # all interest shares
|
||||
|
||||
if len(share_symbols) != 0: # iterate through all shares
|
||||
|
||||
shares = p_my_handler.get_user_shares(p_user_id) # all interest shares
|
||||
|
||||
if len(share_symbols) != 0: # iterate through all shares
|
||||
for i in range(len(share_symbols)):
|
||||
my_price = share_fetcher.get_share_price_no_currency(share_symbols[i])
|
||||
my_update_message = f'{share_fetcher.get_share_information_markdown(share_symbols[i])}\ncount: {hf.make_markdown_proof(share_amounts[i])}\nTotal: {hf.make_markdown_proof(round(float(my_price) * float(share_amounts[i]), 2))} EUR'
|
||||
|
Reference in New Issue
Block a user