breaking-news-bot
所属分类:聊天室
开发工具:Python
文件大小:0KB
下载次数:0
上传日期:2023-11-06 16:26:36
上 传 者:
sh-1993
说明: 电报机器人提供突发新闻标题以及来源的URL。
(The Telegram bot provides breaking news headlines along with a URL to the source.)
文件列表:
.env.dist (101, 2023-11-06)
Dockerfile (332, 2023-11-06)
bot.py (1466, 2023-11-06)
config/ (0, 2023-11-06)
config/__init__.py (40, 2023-11-06)
config/base.py (932, 2023-11-06)
config/config.py (814, 2023-11-06)
data/ (0, 2023-11-06)
docker-compose.yml (184, 2023-11-06)
requirements/ (0, 2023-11-06)
requirements/base.txt (380, 2023-11-06)
requirements/local.txt (12, 2023-11-06)
requirements/production.txt (11, 2023-11-06)
src/ (0, 2023-11-06)
src/__init__.py (0, 2023-11-06)
src/formatters/ (0, 2023-11-06)
src/formatters/news.py (554, 2023-11-06)
src/handlers/ (0, 2023-11-06)
src/handlers/__init__.py (0, 2023-11-06)
src/handlers/user_handlers.py (1220, 2023-11-06)
src/middlewares/ (0, 2023-11-06)
src/middlewares/__init__.py (0, 2023-11-06)
src/middlewares/storage.py (801, 2023-11-06)
src/models/ (0, 2023-11-06)
src/models/__init__.py (0, 2023-11-06)
src/models/news.py (216, 2023-11-06)
src/services/ (0, 2023-11-06)
src/services/__init__.py (0, 2023-11-06)
src/services/news/ (0, 2023-11-06)
src/services/news/__init__.py (29, 2023-11-06)
src/services/news/news.py (3414, 2023-11-06)
src/services/storage/ (0, 2023-11-06)
src/services/storage/__init__.py (36, 2023-11-06)
src/services/storage/base.py (1390, 2023-11-06)
... ...
# Breaking News Telegram Bot
![aiogram](https://img.shields.io/badge/python-v3.10-blue.svg?logo=python&logoColor=yellow) ![aiogram](https://img.shields.io/badge/aiogram-v3-blue.svg?logo=telegram)
The main feature of this bot is to deliver latest news headlines related to technology along with a URL to the source to keep users up to date with the latest news and developments in the tech industry. The bot is designed to have only one command, `/start`, which initiates the bot and sends a short description of its capabilities. Any message sent to the bot will receive a notification that the bot only sends news and does not receive messages.
![Screenshot](https://i.ibb.co/sPH56W2/Group-2.png)
### Requirements
- Linux
- Python v3.10
- aiogram v3
- dotenv v1 - for the bot configuration
- [newsapi-python](https://github.com/mattlisiv/newsapi-python) - for using [NewsAPI](https://newsapi.org/)
- [aiosqlite](https://github.com/omnilib/aiosqlite) - for keeping users ids
- APScheduler v3.1 - for scheduling tasks
### Installation
To get started with this bot, follow these steps:
- Clone this repository to your local machine.
```
$ git clone [source]
```
- Create a virtual environment, activate it and install required dependencies.
```
$ python3.10 -m venv env
$ source env/bin/activate
$ pip install -r requirements/local.txt
```
- Create a new bot on Telegram by talking to the BotFather, and [obtain the API token](https://www.siteguarding.com/en/how-to-get-telegram-bot-api-token).
- Get an API key on the [NewsAPI](https://newsapi.org/) website.
- Rename the file `.env.dist` to `.env` and replace the placeholders with required data.
- Run the bot using `python bot.py`.
近期下载者:
相关文件:
收藏者: