A Discord bot that fetches the most recent top article from AP News' politics section on request and makes a neat summary of the article and key terms.
- Redis Cloud for caching article data.
- Groq for natural language processing.
- Playwright for web scraping.
- BeautifulSoup4 (BS4) for parsing HTML content
-
Clone the repository:
git clone https://github.com/aleguy02/Informed-Citizen-Bot.git cd Informed-Citizen-Bot -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the root directory and add the following configuration variables:DISCORD_TOKEN=your_discord_token REDIS_URL=your_redis_url GROQ_API_KEY=your_groq_api_key
-
Ensure you have the required API keys and tokens for Discord, Redis Cloud, and Groq.
-
Start the bot:
python bot.py
-
Invite the bot to your Discord server using the OAuth2 URL with the
botscope and necessary permissions. -
Use the bot commands in your Discord server to fetch the latest top article from AP News' politics section.