forked from LawOff/Discord-Server-Cloner-OUTDATED-
/
main.py
69 lines (61 loc) · 2.37 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import os
import discord
from discord.ext import commands
import asyncio
import logging
import random
from colorama import init
from colorama import Fore, Style
import requests
import json
import datetime
import random
import threading
import random
import time
import threading
init()
os.system("cls" or "clear")
token = input('{}\n[>] {} TOKEN: {}'.format(Fore.RESET, Fore.LIGHTYELLOW_EX, Fore.RESET))
prefix = input('{}\n[>] {} PREFIX: {}'.format(Fore.RESET, Fore.LIGHTYELLOW_EX, Fore.RESET))
client = commands.Bot(command_prefix=prefix, case_insensitive=True,
self_bot=True)
client.remove_command('help')
header = {"Authorization": f'Bot {token}'}
os.system('cls' if os.name == 'nt' else 'clear')
os.system('cls' if os.name == 'nt' else 'clear')
intents = discord.Intents.all()
intents.members = True
@client.event
async def on_ready():
print('------')
print('{}\n[>] {} Selfbot running... {}'.format(Fore.RESET, Fore.LIGHTYELLOW_EX, Fore.RESET))
print('{}\n[>] {} Command:{} {}copyserver\n'.format(Fore.RESET, Fore.LIGHTYELLOW_EX, Fore.RESET, prefix))
print(' - Logged in as ' + client.user.name)
print(' - User ID: ' + str(client.user.id))
print('\n------\n')
@client.command()
async def copyserver(ctx):
await ctx.message.delete()
wow = await client.create_guild(f'backup-{ctx.guild.name}')
await asyncio.sleep(4)
for g in client.guilds:
if f'backup-{ctx.guild.name}' in g.name:
for c in g.channels:
await c.delete()
for cate in ctx.guild.categories:
x = await g.create_category(f"{cate.name}")
for chann in cate.channels:
if isinstance(chann, discord.VoiceChannel):
await x.create_voice_channel(f"{chann}")
if isinstance(chann, discord.TextChannel):
await x.create_text_channel(f"{chann}")
print(ctx.guild.roles)
for role in ctx.guild.roles[::-1]:
if role.name != "@everyone":
try:
await wow.create_role(name=role.name, color=role.color, permissions=role.permissions, hoist=role.hoist, mentionable=role.mentionable)
print(f"Created new role : {role.name}")
except:
break
client.run(token, bot=False)