Using discord cdn as a cloud storage!
Python 3.8 or higher is required
First, download the source code of the project. You can obtain the project's source code by:
git clone https://github.com/watermelon1024/discord-storage.git
cd discord-storage
Before installing the project, it's recommended to use a virtual environment to isolate the project's dependencies and prevent conflicts with dependencies of other projects.
python -m venv venv
pip install virtualenv
virtualenv venv
# Windows
venv\Scripts\activate
# Linux/macOS
source venv/bin/activate
Rename the .env.example file to .env and fill in the required values for each environment variable according to your configuration.
.env.example
:
TOKEN= # discord bot token
CHANNEL= # storage channel ID (private channel recommend)
SERVER_HOST=127.0.0.1 # web server host
SERVER_PORT=8000 # web server port
CACHE_MAX_SIZE=512MB # cache max size
CACHE_MAX_TTL=24h # cache max ttl
- Install Dependencies Install the dependencies required for the project.
pip install -r requirements.txt
- Run the Project Once the dependencies are installed and the environment variables are set up, you can run the project!
# Run the project in the project directory
python main.py