diff --git a/Dockerfile.client b/Dockerfile.client new file mode 100644 index 0000000..b7cacbf --- /dev/null +++ b/Dockerfile.client @@ -0,0 +1,15 @@ +FROM python:3.8-slim-buster + +WORKDIR /app + +COPY requirements.txt /app/requirements.txt + +RUN pip install -r requirements.txt + +COPY client.py /app/client.py + +COPY proxies.txt /app/proxies.txt + +COPY settings.yaml /app/settings.yaml + +CMD ["python", "/app/client.py"] \ No newline at end of file diff --git a/Dockerfile.server b/Dockerfile.server new file mode 100644 index 0000000..be9fa52 --- /dev/null +++ b/Dockerfile.server @@ -0,0 +1,17 @@ +FROM python:3.8-slim-buster + +WORKDIR /app + +COPY requirements.txt /app/requirements.txt + +RUN pip install -r requirements.txt + +COPY server.py /app/server.py + +COPY proxies.txt /app/proxies.txt + +COPY settings.yaml /app/settings.yaml + +EXPOSE 8002 + +CMD ["python", "/app/server.py"] \ No newline at end of file diff --git a/README.md b/README.md index 5319f4b..a7ef61c 100644 --- a/README.md +++ b/README.md @@ -1,83 +1,6 @@ -# DiscordWizard: Your Portal to Discord Server Replication 🧙‍♂️ - -Welcome to the world of DiscordWizard, your trusty ally for cloning entire Discord servers. With its unique and efficient powers, DiscordWizard will help you mirror a Discord server in no time. - -![DiscordWizard: The Ultimate Replicator](https://i.imgur.com/0s4UXzP.png) - -To work with DiscordWizard, you'll need: -- The token of a Discord account that is a member of the server you wish to copy -- A target server where the messages will be replicated, along with the token of an account with administrative privileges -- That's it! You're ready to go. - -## How DiscordWizard Works 🎩 - -DiscordWizard operates by having the account in the source server monitor changes and new messages using a websocket. The target account then replicates these changes, creating categories, channels, and even renaming them as needed. Messages are sent through webhooks, ensuring a seamless connection between servers. - -To set up DiscordWizard, configure the `settings.yaml` file as shown: - -```yaml -client: - token: "" # Token of the account in the server to be mirrored - server_id: 107... # Server ID - excluded_channels: - - 0 # List of excluded channels, if any - regex_filter: "(badword1|badword2)" # Regex to block forwarding of messages based on it - -server: - token: "" # Administrator token within your server - server_id: 109... # Your server ID - interval: 60 # Delay in seconds between interactions with Discord APIs to create channels/webhooks/categories - webhook_name: "DiscordWizard" # Webhook name to use - websocket: - port: 8080 # Port to use - host: "localhost" # Host to use -``` -Additionally, you can use the `proxies.txt` file to provide a list of proxies to prevent hitting Discord rate limits when mirroring large servers with high message volume. List one proxy per line in the format `ip:port:user:pass` or `ip:port`. - -To start the server, run: -```bash -python3 server.py -``` -To launch the client, execute: -```bash -python3 client.py -``` -And just like that, the replication begins! 🎉 - -DiscordWizard separates the client and server into two different scripts. This versatile design allows you to mirror multiple source servers (clients) to the same target server, broadening your possibilities and streamlining the process. - -*Note*: The first time you run DiscordWizard, it will create channels, categories, and webhooks. This may take a moment due to Discord's rate limit restrictions. For larger servers, use a higher interval (40/60) to avoid hitting Discord's rate limits. - -## How to Contribute 🤝 - -We welcome and appreciate contributions from the community! If you'd like to contribute to DiscordWizard, here's how you can get involved: - -1. **Fork the repository**: Click the 'Fork' button at the top-right corner of the main GitHub page to create your own copy of the repository. - -2. **Clone your fork**: Clone your forked repository to your local machine using `git clone https://github.com/YOUR-USERNAME/DiscordWizard.git`. - -3. **Create a branch**: Before making any changes, create a new branch for your contribution using `git checkout -b your-feature-branch`. - -4. **Make changes**: Implement your feature, fix bugs, or make other improvements to the code. - -5. **Commit and push**: Commit your changes and push them to your forked repository using `git commit -m "Your commit message"` followed by `git push origin your-feature-branch`. - -6. **Create a pull request**: On the GitHub page of your forked repository, click the 'Compare & pull request' button to submit your changes for review. Provide a clear description of your changes and any additional information that may be helpful. - -7. **Stay involved**: Keep an eye on your pull request and be ready to respond to feedback, make changes, or answer questions. Your active participation is crucial for a smooth review process. - By following these steps, you can contribute to the development of DiscordWizard and help make it even better for everyone! We look forward to collaborating with you. 🚀 -## Connect with the Developer 🚀 - -Stay connected and keep up with ongoing projects and innovations. - -💌 For questions or feedback, feel free to reach out via email at [glizzykingdreko@protonmail.com](mailto:glizzykingdreko@protonmail.com). - -🐦 Follow on Twitter for updates and insights at [@glizzykingdreko](https://twitter.com/glizzykingdreko). - -📚 Read more about work on Medium by visiting [medium.com/@glizzykingdreko](https://medium.com/@glizzykingdreko). - -🔮 Explore code repositories on GitHub at [github.com/glizzykingdreko](https://github.com/glizzykingdreko). +## Run with docker compose +**docker-compose build** +**docker-compose up -d** -Join the journey and make your Discord server replication experience a breeze! 🎉 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..ab6cc27 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,21 @@ +version: '3' +services: + server: + build: + context: . + dockerfile: Dockerfile.server + ports: + - "5000:5000" + networks: + - discord + + client: + build: + context: . + dockerfile: Dockerfile.client + networks: + - discord + +networks: + discord: + external: true \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 0848dad..74ebef3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,18 +1,4 @@ -aiohttp==3.7.4.post0 -async-timeout==3.0.1 -asyncio==3.4.3 -attrs==22.2.0 -certifi==2022.12.7 -chardet==4.0.0 -charset-normalizer==3.1.0 -discord.py-self==1.9.2 -idna==3.4 -multidict==6.0.4 -pyaml==21.10.1 -PyYAML==6.0 -requests==2.28.2 -resilient-caller==0.2.1 -typing_extensions==4.5.0 urllib3==1.26.15 websockets==11.0 yarl==1.8.2 +PyNaCl==1.4.0 \ No newline at end of file diff --git a/settings.yaml b/settings.yaml index 0111783..b4dcbff 100644 --- a/settings.yaml +++ b/settings.yaml @@ -1,15 +1,15 @@ client: - token: "Nj..." - server_id: 1071... + token: "" + server_id: excluded_channels: - 0 - regex_filter: "(badword1|badword2)" + regex_filter: "" server: - token: "OD..." - server_id: 108... + token: "" + server_id: interval: 60 - webhook_name: DiscordWizard + webhook_name: "" websocket: - port: 8080 - host: "localhost" \ No newline at end of file + port: 5000 + host: "0.0.0.0" \ No newline at end of file