This bot randomly sends UFO images to configured channels and tracks user reactions.
- Python 3.8 or higher
- A Discord application and bot token
-
Clone the repository
git clone https://github.com/jmartgmz/ufo-sighting-bot.git cd ufo-sighting-bot -
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
cp .env.example .env # Edit .env and add your Discord bot token -
Run the bot
python run_bot.py
Or run directly from the src directory:
python src/ufo_main.py
- Go to the Discord Developer Portal
- Create a new application
- Go to the "Bot" section and create a bot
- Copy the bot token and add it to your
.envfile - Go to "OAuth2" > "URL Generator"
- Select scopes:
bot,applications.commands - Select permissions:
Send Messages,Add Reactions,Manage Messages,Use Slash Commands - Invite the bot to your server using the generated URL
- Use
/setchannelin the channel where you want UFO images to appear - The bot will start sending random UFO images at random intervals
- React with 👽 to the images to track your sightings
- Check your progress with
/usersightingsor/globalsightings
ufo-sighting-bot/
├── src/ # Source code
│ ├── commands/ # Command modules
│ │ ├── __init__.py # Commands package init
│ │ ├── admin.py # Bot info and admin commands
│ │ ├── setup.py # Channel setup and testing
│ │ └── sightings.py # Reaction tracking and leaderboards
│ ├── utils/ # Utility modules
│ │ ├── __init__.py # Utils package init
│ │ ├── auth.py # User authorization management
│ │ ├── config.py # Configuration management
│ │ └── helpers.py # Helper functions and constants
│ ├── ufo_main.py # Main bot file
│ └── ufo_main_backup.py # Backup of original monolithic file
├── data/ # Data files (gitignored)
│ ├── config.json # Server configurations
│ ├── reactions.json # Reaction tracking data
│ ├── authorized_users.json # User authorization settings
│ ├── config.json.example # Example server config
│ ├── reactions.json.example # Example reactions file
│ └── authorized_users.json.example # Example auth config
├── logs/ # Log files
├── docs/ # Documentation
├── run_bot.py # Bot launcher script
├── setup.sh # Setup script for new installations
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── .gitignore # Git ignore rules
└── README.md # This file
The bot automatically creates and manages several configuration files with persistent storage:
data/config.json- Stores channel configurations for each serverdata/reactions.json- Tracks user reaction counts across all servers (survives bot restarts)data/authorized_users.json- Controls who can use restricted commands
The bot includes a built-in authorization system for sensitive commands:
Admin Users - Can manage other users' permissions and use all admin commands
Botinfo Users - Can use the /botinfo command to view bot statistics
Default Setup:
- On first run, the bot creates
data/authorized_users.jsonwith your Discord ID as an admin - Admins can use
/authorize @userto grant botinfo access - Use
/deauthorize @userto remove access - Use
/listauthorizedto see all authorized users
This project is licensed under the MIT License - see the LICENSE file for details.