This Discord bot fetches the top stories from Hacker News and posts them in your specified Discord channel.
Before you begin, ensure you have met the following requirements:
- You have a Discord account and have created a bot on the Discord Developer Portal.
- You have installed Python 3.8 or higher on your machine.
Follow these steps to set up the News Discord Bot:
- Clone the repository:
git clone https://github.com/EthanM97/news-discord-bot.git
cd news-discord-bot
- Create a virtual environment:
For Unix/macOS:
python3 -m venv venv
source venv/bin/activate
For Windows:
python -m venv venv
.\venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Configure your bot:
Open the news_bot.py
file and replace YOUR_BOT_TOKEN
with your actual Discord bot token.
- Run the bot:
python news_bot.py
!greeting
: The bot will respond with a greeting message.!news
: The bot fetches and posts the top stories from Hacker News.!clear
: The bot will clear the last 50 messages in the channel.