implemented /news and deleted debugbot (edit BOT_API_KEY instead) #2

Merged
Rripped merged 40 commits from bot-features into main 2022-03-16 09:08:43 +00:00
3 changed files with 5 additions and 4 deletions
Showing only changes of commit af01a7e183 - Show all commits

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
env
__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