Immich Discord Selfbot is Discord bot designed to manage and interact with assets stored on your immich server. It provides functionality to fetch random assets, get specific assets, mark assets as favorites, delete assets, and view server statistics.
- Fetch and display random assets with filtering options:
- Filter by media type (image/video)
- Filter by file size (min/max)
- Fetch multiple assets at once
- Cancel ongoing searches
- Get specific assets by ID
- Mark assets as favorites
- Delete assets
- View server statistics
- User-specific preferences with account type support
- Help commands for easy reference
- Python 3.7 or higher
- Immich
- Docker (optional, but highly recommended)
-
Clone the repository:
git clone https://github.com/jakedev796/immich-discord-selfbot.git cd immich-discord-selfbot
-
Install the required dependencies:
pip install -r requirements.txt
-
Copy the
.env.sample
file to.env
:cp .env.sample .env
-
Copy the preferences template:
mkdir -p data cp data/preferences.json.example data/preferences.json
-
Edit the
.env
file and fill in your actual API keys, Discord bot token, and base URL:BASE_URL=https://photos.example.com API_KEY=your_regular_api_key ADMIN_API_KEY=your_admin_api_key DISCORD_TOKEN=your_discord_user_token BOT_PREFIX=.
-
Run the bot:
python main.py
-
Clone the repository:
git clone https://github.com/jakedev796/immich-discord-selfbot.git cd immich-discord-selfbot
-
Copy and edit the configuration files:
cp .env.sample .env mkdir -p data cp data/preferences.json.example data/preferences.json
-
Edit the
.env
file as described in step 5 of the Python installation. -
Build and run the Docker container:
docker-compose up --build
The bot responds to the following commands:
.random [options]
: Fetches and displays random assets- Options:
min:size
: Minimum file size (e.g., min:2mb, min:500kb)max:size
: Maximum file size (e.g., max:5mb, max:900kb)image/video
: Asset type filtercount:n
: Number of assets to fetch (max 10)
- Example:
.random min:2mb max:5mb image count:3
- Options:
.get <asset_id>
: Fetches and displays a specific asset.favorite <asset_id|last>
: Marks an asset as a favorite.unfavorite <asset_id|last>
: Removes an asset from favorites.delete <asset_id|last>
: Deletes a specific asset.stats
: Displays server statistics.cancel
: Cancels an ongoing random search
.prefs
: Show current preferences.prefs set <setting> <value>
: Update a preference- Available settings:
media_type
(aliases: mt, type): Default media type (image, video, all)min_size
(aliases: mins, min): Default minimum file sizeaccount_type
(aliases: account): Discord account type (basic, nitro_basic, nitro)max_attempts
(aliases: attempts, retry): Maximum API retry attemptsupdate_interval
(aliases: interval, update): Progress update interval
- Available settings:
.prefs reset
: Reset preferences to defaults.helppref
: Show detailed preference settings help
The bot supports different Discord account types with their corresponding upload limits:
- Basic: 25MB limit
- Nitro Basic: 50MB limit
- Nitro: 500MB limit
File size limits are automatically enforced based on the user's account type.
.help
: Shows general help message.helppref
: Shows detailed preference settings help
The bot uses the following environment variables, which should be set in the .env
file:
BASE_URL
: The base URL of the asset serverAPI_KEY
: The regular API key for accessing the asset serverADMIN_API_KEY
: The admin API key for accessing server statisticsDISCORD_TOKEN
: Your Discord user tokenBOT_PREFIX
: Command prefix for the bot (default is '.')
User preferences are stored in data/preferences.json
and persist across bot restarts. The following preferences can be configured:
- Account type (determines maximum file size)
- Default media type (image/video/all)
- Minimum file size
- Maximum API retry attempts
- Progress update interval
This repository contains code that may be used for Discord selfbots, which are against Discord's Terms of Service. Using a selfbot can result in your account being banned or suspended. The creator and contributors are not responsible for any consequences, including account bans or data loss. Use this code at your own risk and for educational purposes only.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please open an issue on the GitHub repository.