hoffentlich geht es bei dir

This commit is contained in:
Florian Kellermann
2022-03-16 09:30:33 +01:00
parent eaeb0d4ed5
commit 267a7db04b
3 changed files with 52 additions and 3 deletions

View File

@@ -22,12 +22,14 @@ import sys
import logging
import news.news_fetcher as news
import share_fetcher
import shares.share_fetcher as share_fetcher
import shares.wait_for_share
from telebot import types
from dotenv import load_dotenv
from share_fetcher import Share_Handler
load_dotenv()
bot_version = "0.1.1"
@@ -107,7 +109,7 @@ def send_welcome(message):
:rtype: none
"""
bot.reply_to(message, "/id or /auth for authentication. /update to get updates on your shares. /users to see all users. /news to get current use for your keywords. For further details see aktienbot.flokaiser.com")
bot.reply_to(message, "/id or /auth for authentication. /update to get updates on your shares. /users to see all users. /news to get current use for your keywords. /share to get price of specific share. For further details see aktienbot.flokaiser.com")
@bot.message_handler(commands=['users'])
@@ -148,7 +150,7 @@ def send_id(message):
bot.reply_to(message, answer)
@bot.message_handler(commands=['update']) # /update -> send static update via user_id to this user, later fetch from database
@bot.message_handler(commands=['update'])
def send_update(message):
""" Send update on shares
@@ -166,6 +168,27 @@ def send_update(message):
#Get Information for user with this id
#call Share_Handler
bot.send_message(chat_id=user_id, text='This is your update')
@bot.message_handler(commands=['share'])
def send_update(message):
""" Send price of a specific share
:type message: message object bot
:param message: message that was reacted to, in this case always containing '/share'
:raises: none
:rtype: none
"""
user_id = int(message.from_user.id)
#Get Information for user with this id
bot.send_message(chat_id=user_id, text='Send symbol of share:')
str_share_price = shares.wait_for_share.main_loop(bot)
@bot.message_handler(commands=['news'])