-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathmain.py
56 lines (51 loc) · 1.86 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
import os
import discord
from discord.ext import commands
import asyncio
import logging
import random
from colorama import Fore
import requests
import json
import datetime
import random
import threading
import random
import time
import threading
token = input("\033[0;96m[~\033[0;96m] \033[0;96mTOKEN - ")
prefix = input("\033[0;96m[~\033[0;96m] \033[0;96mPREFIX - ")
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')
#yt links doesnt work
intents = discord.Intents.all()
intents.members = True
@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)