Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up Discord Replica Server #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Dockerfile.client
Original file line number Diff line number Diff line change
@@ -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"]
17 changes: 17 additions & 0 deletions Dockerfile.server
Original file line number Diff line number Diff line change
@@ -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"]
83 changes: 3 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 [[email protected]](mailto:[email protected]).

🐦 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! 🎉
21 changes: 21 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 1 addition & 15 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
16 changes: 8 additions & 8 deletions settings.yaml
Original file line number Diff line number Diff line change
@@ -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"
port: 5000
host: "0.0.0.0"