├── token.txt ├── CodeXPreview.png ├── func ├── __pycache__ │ ├── cloner.cpython-311.pyc │ ├── cloner.cpython-313.pyc │ ├── guild_info.cpython-311.pyc │ ├── guild_info.cpython-313.pyc │ ├── user_info.cpython-311.pyc │ ├── clone_emojis.cpython-311.pyc │ ├── clone_emojis.cpython-313.pyc │ ├── token_checker.cpython-311.pyc │ ├── token_checker.cpython-313.pyc │ ├── clone_stickers.cpython-311.pyc │ └── clone_stickers.cpython-313.pyc ├── token_checker.py ├── clone_emojis.py ├── clone_stickers.py ├── guild_info.py └── cloner.py ├── utils ├── __pycache__ │ ├── innit.cpython-311.pyc │ └── innit.cpython-313.pyc └── innit.py ├── requirements.txt ├── Setup.bat ├── CodexCloner.py ├── LICENSE └── README.md /token.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CodeXPreview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/CodeXPreview.png -------------------------------------------------------------------------------- /func/__pycache__/cloner.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/func/__pycache__/cloner.cpython-311.pyc -------------------------------------------------------------------------------- /func/__pycache__/cloner.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/func/__pycache__/cloner.cpython-313.pyc -------------------------------------------------------------------------------- /utils/__pycache__/innit.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/utils/__pycache__/innit.cpython-311.pyc -------------------------------------------------------------------------------- /utils/__pycache__/innit.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/utils/__pycache__/innit.cpython-313.pyc -------------------------------------------------------------------------------- /func/__pycache__/guild_info.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/func/__pycache__/guild_info.cpython-311.pyc -------------------------------------------------------------------------------- /func/__pycache__/guild_info.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/func/__pycache__/guild_info.cpython-313.pyc -------------------------------------------------------------------------------- /func/__pycache__/user_info.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/func/__pycache__/user_info.cpython-311.pyc -------------------------------------------------------------------------------- /func/__pycache__/clone_emojis.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/func/__pycache__/clone_emojis.cpython-311.pyc -------------------------------------------------------------------------------- /func/__pycache__/clone_emojis.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/func/__pycache__/clone_emojis.cpython-313.pyc -------------------------------------------------------------------------------- /func/__pycache__/token_checker.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/func/__pycache__/token_checker.cpython-311.pyc -------------------------------------------------------------------------------- /func/__pycache__/token_checker.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/func/__pycache__/token_checker.cpython-313.pyc -------------------------------------------------------------------------------- /func/__pycache__/clone_stickers.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/func/__pycache__/clone_stickers.cpython-311.pyc -------------------------------------------------------------------------------- /func/__pycache__/clone_stickers.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titanxdevz/Code-x-Cloner/HEAD/func/__pycache__/clone_stickers.cpython-313.pyc -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | psutil 2 | Presence 3 | discord 4 | asyncio 5 | colorama 6 | fore 7 | pystyle 8 | psutil 9 | pypresence 10 | discord 11 | asyncio 12 | colorama 13 | platforms 14 | discord==1.7.3 15 | discord.py==1.7.3 16 | -------------------------------------------------------------------------------- /Setup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | pip install psutil 3 | pip install Presence 4 | pip install discord 5 | pip install asyncio 6 | pip install colorama 7 | pip install fore 8 | pip install pystyle 9 | pip3 install --user psutil 10 | pip3 install --user pypresence 11 | pip3 install --user discord 12 | pip3 install --user asyncio 13 | pip3 install --user colorama 14 | pip3 install --user platforms 15 | pip3 install discord==1.7.3 16 | pip3 install discord.py==1.7.3 17 | -------------------------------------------------------------------------------- /func/token_checker.py: -------------------------------------------------------------------------------- 1 | from utils.innit import * 2 | 3 | async def token_checker(): 4 | clear() 5 | logo() 6 | 7 | valid = 0 8 | invalid = 0 9 | 10 | with open('token.txt')as f: 11 | token = f.readline().strip() 12 | 13 | headers = { 14 | "Authorization": token 15 | } 16 | 17 | url = "https://discord.com/api/v9/users/@me" 18 | 19 | response = requests.get(url, headers=headers) 20 | 21 | if response.status_code == 200: 22 | valid += 1 23 | t = current_time() 24 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Token Valid") 25 | else: 26 | t = current_time() 27 | invalid += 1 28 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Token Invalid") 29 | 30 | final = f""" 31 | {b}[{w}{valid}{b}]{w} {g}Valid{w} 32 | {b}[{w}{invalid}{b}]{w} {r}Invalid{w} 33 | """ 34 | clear() 35 | logo() 36 | print(final) 37 | input(f" {b}[{w}#{b}]{w} Press ENTER to Return.") -------------------------------------------------------------------------------- /CodexCloner.py: -------------------------------------------------------------------------------- 1 | from utils.innit import * 2 | from func.cloner import * 3 | from func.clone_stickers import * 4 | from func.clone_emojis import * 5 | from func.guild_info import * 6 | from func.token_checker import * 7 | 8 | async def menu(): 9 | while True: 10 | clear() 11 | logo() 12 | o = f""" 13 | {b}[{w}01{b}]{w} Server Copy {b}[{w}04{b}]{w} Server Status 14 | {b}[{w}02{b}]{w} Server Sticker Copy {b}[{w}05{b}]{w} Token Checker 15 | {b}[{w}03{b}]{w} Server Emoji Copy """ 16 | print(o) 17 | cs = input(f" {b}[{w}Code X Cloner{b}]{w} >> ") 18 | 19 | if cs == "1": 20 | await cloner() 21 | elif cs == "2": 22 | await sticker_cloner() 23 | elif cs == "3": 24 | await emoji_cloner() 25 | elif cs == "4": 26 | await guild_info() 27 | elif cs == "5": 28 | await token_checker() 29 | 30 | 31 | if __name__ == "__main__": 32 | asyncio.run(menu()) 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 WAESTA 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /utils/innit.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import threading 3 | import asyncio 4 | import base64 5 | from pystyle import * 6 | import random 7 | from datetime import datetime 8 | import os 9 | import time 10 | 11 | def logo(): 12 | l = """ 13 | ██████╗ ██████╗ ██████╗ ███████╗ ██╗ ██╗ 14 | ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ╚██╗██╔╝ 15 | ██║ ██║ ██║██║ ██║█████╗ ╚███╔╝ 16 | ██║ ██║ ██║██║ ██║██╔══╝ ██╔██╗ 17 | ╚██████╗╚██████╔╝██████╔╝███████╗ ██╔╝ ██╗ 18 | ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ 19 | 20 | Discord.gg/5yqxjKdyy8 21 | Made By Code X Community 22 | """ 23 | c = Colorate.Horizontal(Colors.blue_to_cyan, l) 24 | print(c) 25 | 26 | def clear(): 27 | os.system('cls' if os.name == 'nt' else 'clear') 28 | 29 | def current_time(): 30 | return datetime.now().strftime("%H:%M:%S") 31 | 32 | b = Colors.dark_blue 33 | r = Colors.red 34 | g = Colors.green 35 | y = Colors.yellow 36 | w = Colors.white 37 | 38 | -------------------------------------------------------------------------------- /func/clone_emojis.py: -------------------------------------------------------------------------------- 1 | from utils.innit import * 2 | import time 3 | 4 | async def emoji_cloner(): 5 | clear() 6 | logo() 7 | guild_id = input(f" {b}[{w}Server You Want to Copy : {b}]{w} >> ") 8 | clear() 9 | logo() 10 | 11 | with open('token.txt') as f: 12 | token = f.readline().strip() 13 | 14 | headers = { 15 | "Authorization": token, 16 | "User-Agent": "DiscordBot (https://discord.com, v1)" 17 | } 18 | 19 | emojis_url = f"https://discord.com/api/v10/guilds/{guild_id}/emojis" 20 | response = requests.get(emojis_url, headers=headers) 21 | 22 | if response.status_code in [200, 204]: 23 | data = response.json() 24 | guild_info_url = f"https://discord.com/api/v10/guilds/{guild_id}" 25 | guild_info_response = requests.get(guild_info_url, headers=headers) 26 | 27 | if guild_info_response.status_code in [200, 204]: 28 | guild_name = guild_info_response.json().get("name", "UnknownGuild").replace("/", "_") 29 | folder_name = f"emojis_{guild_name}" 30 | 31 | if not os.path.exists(folder_name): 32 | os.mkdir(folder_name) 33 | 34 | for emoji in data: 35 | emoji_id = emoji['id'] 36 | emoji_name = emoji['name'].replace("/", "_") 37 | is_animated = emoji.get('animated', False) 38 | 39 | file_url = f"https://cdn.discordapp.com/emojis/{emoji_id}.webp?size=56" 40 | if is_animated: 41 | file_url += "&animated=true" 42 | file_ext = "webp" 43 | else: 44 | file_ext = "webp" 45 | 46 | num = random.randint(1, 20000) 47 | file_path = os.path.join(folder_name, f"{num}.{file_ext}") 48 | 49 | with open(file_path, "wb") as f: 50 | emoji_data = requests.get(file_url, headers=headers).content 51 | f.write(emoji_data) 52 | t = current_time() 53 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Downloaded: {emoji_name} ({emoji_id})") 54 | else: 55 | t = current_time() 56 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Could Not Create Folder") 57 | else: 58 | t = current_time() 59 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Folder Created") -------------------------------------------------------------------------------- /func/clone_stickers.py: -------------------------------------------------------------------------------- 1 | from utils.innit import * 2 | import time 3 | 4 | async def sticker_cloner(): 5 | clear() 6 | logo() 7 | guild_id = input(f" {b}[{w}Server You Want to Copy : {b}]{w} >> ") 8 | clear() 9 | logo() 10 | 11 | with open('token.txt') as f: 12 | token = f.readline().strip() 13 | 14 | headers = { 15 | "Authorization": token, 16 | "User-Agent": "DiscordBot (https://discord.com, v1)" 17 | } 18 | 19 | stickers_url = f"https://discord.com/api/v10/guilds/{guild_id}/stickers" 20 | response = requests.get(stickers_url, headers=headers) 21 | 22 | if response.status_code in [200, 204]: 23 | data = response.json() 24 | guild_info_url = f"https://discord.com/api/v10/guilds/{guild_id}" 25 | guild_info_response = requests.get(guild_info_url, headers=headers) 26 | 27 | if guild_info_response.status_code in [200, 204]: 28 | guild_name = guild_info_response.json().get("name", "UnknownGuild").replace("/", "_") 29 | folder_name = f"stickers_{guild_name}" 30 | 31 | if not os.path.exists(folder_name): 32 | os.mkdir(folder_name) 33 | 34 | for sticker in data: 35 | sticker_id = sticker['id'] 36 | sticker_name = sticker['name'].replace("/", "_") 37 | 38 | if sticker['format_type'] == 4: 39 | file_url = f"https://media.discordapp.net/stickers/{sticker_id}.gif?size=240" 40 | file_ext = "gif" 41 | elif sticker['format_type'] == 1: 42 | file_url = f"https://media.discordapp.net/stickers/{sticker_id}.webp?size=240&quality=lossless" 43 | file_ext = "webp" 44 | else: 45 | continue 46 | 47 | num = random.randint(1, 20000) 48 | file_path = os.path.join(folder_name, f"{num}.{file_ext}") 49 | 50 | with open(file_path, "wb") as f: 51 | sticker_data = requests.get(file_url, headers=headers).content 52 | f.write(sticker_data) 53 | t = current_time() 54 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Downloaded: {sticker_name} ({sticker_id})") 55 | else: 56 | t = current_time() 57 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Could Not Create Folder") 58 | else: 59 | t = current_time() 60 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Folder Created") -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |

3 | Typing SVG 4 |

5 | 6 |

7 | 8 | 9 |

10 | 11 |

12 | 🚀 Clone entire Discord servers including channels, roles, emojis, and more! 13 |

14 | 15 |

16 | 17 | 18 | 19 | 20 | 21 |

22 | 23 | --- 24 | 25 | ## 📸 Preview 26 | 27 |

28 | Tool Preview 29 |

30 | 31 | --- 32 | 33 | ## ✨ Features 34 | 35 | - 🔁 Clone Discord servers (channels, roles, categories) 36 | - 😄 Duplicate emojis and stickers 37 | - 📋 Server info fetcher 38 | - 🛡️ Token validity checker 39 | - 🖥️ Simple CLI with menu interface 40 | 41 | --- 42 | 43 | ## 📦 Setup 44 | 45 | ### 1. Clone the Repo 46 | 47 | ```bash 48 | git clone https://github.com/ApsXminer/Code-x-Cloner 49 | cd Code-x-Cloner 50 | ``` 51 | 52 | ### 2. Install Requirements 53 | 54 | ```bash 55 | pip install -r requirements.txt 56 | ``` 57 | 58 | ### 3. Add Your Token 59 | 60 | Paste your **Discord account token** into `token.txt` (same directory as the script). 61 | > ⚠️ Recommended: Use an alt or bot account with proper permissions. 62 | 63 | --- 64 | 65 | ## ▶️ Usage 66 | 67 | ```bash 68 | python CodexCloner.py 69 | ``` 70 | 71 | Choose from the menu: 72 | - Clone server 73 | - Clone emojis 74 | - Clone stickers 75 | - View server info 76 | - Check token 77 | 78 | --- 79 | 80 | ## ⚠️ Disclaimer 81 | 82 | > This tool is provided for **educational and personal use only**. 83 | > Misusing this tool against Discord’s [Terms of Service](https://discord.com/terms) may result in **account suspension or bans**. 84 | > Always use with your own servers or those you have permission to manage. 85 | 86 | --- 87 | 88 | ## 🧠 Credits 89 | 90 | - Made by **SYNTAX** 91 | - Upgraded by **CODE X** 92 | 93 | --- 94 | 95 | ## 📝 License 96 | 97 | Licensed under the [MIT License](LICENSE). 98 | 99 | --- 100 | 101 | ## 👥 Community & Support 102 | 103 | - 💬 [Join our Discord](https://discord.gg/3xzPkYHd9U) 104 | - 🌟 Star the repo if you like it! 105 | - 🔗 [GitHub - CODE X](https://github.com/ApsXminer) 106 | 107 | --- 108 | 109 |

110 | © 2025 CODEX Team | Developed with ❤️ by ApsXminer 111 |

112 | 113 | -------------------------------------------------------------------------------- /func/guild_info.py: -------------------------------------------------------------------------------- 1 | from utils.innit import * 2 | 3 | async def guild_info(): 4 | clear() 5 | logo() 6 | guild_id = input(f" {b}[{w}SERVER ID : {b}]{w} >> ") 7 | clear() 8 | logo() 9 | 10 | with open('token.txt') as f: 11 | token = f.readline().strip() 12 | 13 | headers = { 14 | "Authorization": token, 15 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" 16 | } 17 | 18 | guild_url = f"https://discord.com/api/v10/guilds/{guild_id}" 19 | response = requests.get(guild_url, headers=headers) 20 | 21 | if response.status_code == 200: 22 | guild = response.json() 23 | 24 | guild_name = guild['name'] 25 | guild_icon = guild.get('icon') 26 | guild_owner_id = guild['owner_id'] 27 | guild_region = guild.get('region', 'N/A') 28 | guild_afk_channel_id = guild.get('afk_channel_id', 'None') 29 | guild_afk_timeout = guild.get('afk_timeout', 'None') 30 | guild_verification_level = guild['verification_level'] 31 | guild_max_members = guild['max_members'] 32 | guild_premium_tier = guild['premium_tier'] 33 | guild_description = guild.get('description', 'No Description') 34 | guild_banner = guild.get('banner') 35 | guild_features = guild['features'] 36 | 37 | guild_icon_url = ( 38 | f"https://cdn.discordapp.com/icons/{guild_id}/{guild_icon}.png" 39 | if guild_icon 40 | else "No Icon" 41 | ) 42 | 43 | guild_banner_url = ( 44 | f"https://cdn.discordapp.com/banners/{guild_id}/{guild_banner}.png?size=512" 45 | if guild_banner 46 | else "No Banner" 47 | ) 48 | t = current_time() 49 | print(f"\n {b}[{w}{t}{b}]{w} {g}[+]{w} Server Information:") 50 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Server Name: {guild_name}") 51 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Server Icon: {guild_icon_url}") 52 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Server Owner ID: {guild_owner_id}") 53 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Area: {guild_region}") 54 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} AFK Channel ID: {guild_afk_channel_id}") 55 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} AFK Timeout: {guild_afk_timeout}") 56 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Verification Level: {guild_verification_level}") 57 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Maximum Members: {guild_max_members}") 58 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Boost Tier: {guild_premium_tier}") 59 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Guild Description: {guild_description}") 60 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Banner: {guild_banner_url}") 61 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Features: {', '.join(guild_features)}") 62 | input(f" {b}[{w}#{b}]{w} Press ENTER to Return.") 63 | else: 64 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Server information could not be retrieved: {response.status_code} - {response.text}") 65 | time.sleep(2) -------------------------------------------------------------------------------- /func/cloner.py: -------------------------------------------------------------------------------- 1 | from utils.innit import * # MADE BY CODE X 2 | import time 3 | 4 | async def cloner(): 5 | clear() 6 | logo() 7 | g_id = input(f" {b}[{w}Provide Server ID You Want To Copy : {b}]{w} >> ") 8 | p_id = input(f" {b}[{w}Provide Server ID You Want To Replicate : {b}]{w} >> ") 9 | clear() 10 | logo() 11 | # MADE BY CODE X 12 | with open('token.txt') as f: 13 | token = f.readline().strip() 14 | 15 | headers = { 16 | "Authorization": token, 17 | "Content-Type": "application/json" 18 | } 19 | 20 | channel_url = f"https://discord.com/api/v9/guilds/{p_id}/channels" 21 | response = requests.get(channel_url, headers=headers) 22 | # MADE BY CODE X 23 | if response.status_code == 200: 24 | channels = response.json() 25 | for channel in channels: 26 | delete_channel_url = f"https://discord.com/api/v9/channels/{channel['id']}" 27 | delete_channel = requests.delete(delete_channel_url, headers=headers) 28 | if delete_channel.status_code in [200, 204]: 29 | t = current_time() 30 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Deleted channel: {channel['name']}") 31 | # MADE BY CODE X 32 | else: 33 | t = current_time() 34 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Failed to Delete Channel {channel['name']}: {delete_channel.status_code}") 35 | else: 36 | t = current_time() 37 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Failed to Fetch Channels: {response.status_code}") 38 | 39 | role_url = f"https://discord.com/api/v9/guilds/{p_id}/roles" 40 | response = requests.get(role_url, headers=headers) 41 | # MADE BY CODE X 42 | if response.status_code == 200: 43 | roles = response.json() 44 | for role in roles: 45 | delete_role_url = f"https://discord.com/api/v9/guilds/{p_id}/roles/{role['id']}" 46 | while True: 47 | delete_response = requests.delete(delete_role_url, headers=headers) 48 | if delete_response.status_code in [200, 204]: 49 | t = current_time() 50 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Deleted Role: {role['name']}") 51 | break 52 | elif delete_response.status_code == 429: 53 | retry_after = int(delete_response.headers.get("Retry-After", 1)) 54 | t = current_time() 55 | print(f" {b}[{w}{t}{b}]{w} {y}[x]{w} Rate Limit : {retry_after} Second") 56 | time.sleep(retry_after) 57 | elif delete_response.status_code == 400: 58 | t = current_time() 59 | print(f" {b}[{w}{t}{b}]{w} {y}[x]{w} Named Role: {role['name']} (Probably @everyone)") 60 | break 61 | else: 62 | t = current_time() 63 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Failed to Delete Role: {role['name']} = {delete_response.status_code}") 64 | break 65 | else: 66 | t = current_time() 67 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Roles Couldn't Be Provided: {response.status_code}") 68 | 69 | guild_url = f"https://discord.com/api/v9/guilds/{g_id}" 70 | response = requests.get(guild_url, headers=headers) 71 | 72 | if response.status_code == 200: 73 | guild = response.json() 74 | guild_name_url = f"https://discord.com/api/v9/guilds/{p_id}" 75 | if guild['icon']: 76 | icon_url = f"https://cdn.discordapp.com/icons/{g_id}/{guild['icon']}.png" 77 | icon_response = requests.get(icon_url) 78 | 79 | if icon_response.status_code == 200: 80 | icon_base64 = base64.b64encode(icon_response.content).decode('utf-8') 81 | icon_data = f"data:image/png;base64,{icon_base64}" 82 | else: 83 | t = current_time() 84 | print(f" {b}[{w}{t}{b}]{w} {y}[x]{w} Failed to fetch server icon. Continuing without icon.") 85 | icon_data = None 86 | else: 87 | t = current_time() 88 | print(f" {b}[{w}{t}{b}]{w} {y}[x]{w} The server has no icon. Continuing without the icon.") 89 | icon_data = None 90 | 91 | payload = { 92 | "name": guild['name'] 93 | } 94 | if icon_data: 95 | payload["icon"] = icon_data 96 | 97 | change_name = requests.patch(guild_name_url, headers=headers, json=payload) 98 | if change_name.status_code == 200: 99 | t = current_time() 100 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Server Name Changed to: {guild['name']}") 101 | if icon_data: 102 | t = current_time() 103 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Server Icon Updated.") 104 | else: 105 | t = current_time() 106 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Failed to Change Server Name/Icon: {change_name.status_code}") 107 | else: 108 | t = current_time() 109 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Failed to Retrieve Server Details: {response.status_code}") 110 | 111 | get_channels_url = f"https://discord.com/api/v9/guilds/{g_id}/channels" 112 | response = requests.get(get_channels_url, headers=headers) 113 | 114 | if response.status_code == 200: 115 | source_channels = response.json() 116 | 117 | categories = [ch for ch in source_channels if ch['type'] == 4] 118 | channels = [ch for ch in source_channels if ch['type'] != 4] 119 | 120 | categories.sort(key=lambda x: x['position']) 121 | channels.sort(key=lambda x: x['position']) 122 | 123 | created_categories = {} 124 | for category in categories: 125 | payload = { 126 | "name": category['name'], 127 | "type": 4, 128 | "permission_overwrites": category['permission_overwrites'] 129 | } 130 | create_category_url = f"https://discord.com/api/v9/guilds/{p_id}/channels" 131 | while True: 132 | create_response = requests.post(create_category_url, headers=headers, json=payload) 133 | if create_response.status_code == 201: 134 | created_category = create_response.json() 135 | created_categories[category['id']] = created_category['id'] 136 | t = current_time() 137 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Category Created: {category['name']}") 138 | break 139 | elif create_response.status_code == 429: 140 | retry_after = int(create_response.headers.get("Retry-After", 1)) 141 | t = current_time() 142 | print(f" {b}[{w}{t}{b}]{w} {y}[x]{w} Rate ​​Limit. {retry_after} Second") 143 | time.sleep(retry_after) 144 | else: 145 | t = current_time() 146 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Category Could Not Be Created: {category['name']} = {create_response.status_code}") 147 | break 148 | 149 | for channel in channels: 150 | payload = { 151 | "name": channel['name'], 152 | "type": channel['type'], 153 | "parent_id": created_categories.get(channel['parent_id']), 154 | "permission_overwrites": channel['permission_overwrites'], 155 | "topic": channel.get('topic', ''), 156 | "nsfw": channel.get('nsfw', False), 157 | "rate_limit_per_user": channel.get('rate_limit_per_user', 0), 158 | } 159 | create_channel_url = f"https://discord.com/api/v9/guilds/{p_id}/channels" 160 | while True: 161 | create_response = requests.post(create_channel_url, headers=headers, json=payload) 162 | if create_response.status_code == 201: 163 | t = current_time() 164 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Created Channel: {channel['name']}") 165 | break 166 | elif create_response.status_code == 429: 167 | retry_after = int(create_response.headers.get("Retry-After", 1)) 168 | t = current_time() 169 | print(f" {b}[{w}{t}{b}]{w} {y}[x]{w} Rate Limit {retry_after} Second") 170 | time.sleep(retry_after) 171 | else: 172 | t = current_time() 173 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Channel Could Not Be Created: {channel['name']} = {create_response.status_code}") 174 | break 175 | else: 176 | t = current_time() 177 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Failed to Fetch Channels from Source Server: {response.status_code}") 178 | 179 | get_roles_url = f"https://discord.com/api/v9/guilds/{g_id}/roles" 180 | response = requests.get(get_roles_url, headers=headers) 181 | 182 | if response.status_code == 200: 183 | source_roles = response.json() 184 | source_roles.sort(key=lambda x: x['position'], reverse=True) # MADE BY CODE X 185 | 186 | for role in source_roles: 187 | payload = { 188 | "name": role['name'], 189 | "permissions": role['permissions'], 190 | "color": role['color'], 191 | "hoist": role['hoist'], 192 | "mentionable": role['mentionable'] # MADE BY CODE X 193 | } 194 | create_role_url = f"https://discord.com/api/v9/guilds/{p_id}/roles" 195 | while True: 196 | create_response = requests.post(create_role_url, headers=headers, json=payload) 197 | if create_response.status_code in [201, 200]: 198 | t = current_time() 199 | print(f" {b}[{w}{t}{b}]{w} {g}[+]{w} Created Role: {role['name']}") 200 | break 201 | elif create_response.status_code == 429: 202 | retry_after = int(create_response.headers.get("Retry-After", 1)) 203 | print(f" {b}[{w}{t}{b}]{w} {y}[x]{w} Rate ​​Limit {retry_after} Second") # MADE BY CODE X 204 | time.sleep(retry_after) 205 | else: 206 | t = current_time() 207 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Failed to Create Role: {role['name']} {create_response.status_code}") 208 | break # MADE BY CODE X 209 | time.sleep(2) 210 | else: 211 | t = current_time() 212 | print(f" {b}[{w}{t}{b}]{w} {r}[-]{w} Failed to Get Roles from Source Server: {response.status_code}") # MADE BY CODE X --------------------------------------------------------------------------------