moved news_fetcher to new dir

This commit is contained in:
Linus E 2022-03-15 14:49:36 +01:00
parent d3a99997b8
commit af01a7e183
3 changed files with 5 additions and 4 deletions

3
.gitignore vendored
View File

@ -2,4 +2,5 @@
.env
env
__pycache__/*
telegram_bot/__pycache__/*
telegram_bot/__pycache__/*
telegram_bot/news/__pycache__/*

View File

@ -21,7 +21,7 @@ import time
import sys
import logging
import news_fetcher
import news.news_fetcher as news
from telebot import types
from dotenv import load_dotenv
@ -92,9 +92,9 @@ def send_news(message):
user_id = int(message.from_user.id)
#Get Information for user with this id
articles = news_fetcher.get_top_news_by_keyword(keyword) #tbd: get keyword from db
articles = news.get_top_news_by_keyword(keyword) #tbd: get keyword from db
try:
formatted_article = news_fetcher.format_article(articles["articles"][0])
formatted_article = news.format_article(articles["articles"][0])
except IndexError:
bot.send_message(chat_id=user_id, text=f"no news currently available for keyword: {keyword}")
return