Message
Message
Message
import asyncio
import requests
import json
import motor
from motor.motor_asyncio import AsyncIOMotorClient
from discord.ext import commands
from discord.commands import Option
import random
import string
import time
import os
import tempfile
from datetime import datetime
import base64
import requests
from requests.auth import HTTPBasicAuth
from datetime import datetime
import json
import re
import os
import dupe
intents = discord.Intents.all()
bot = discord.Bot(Intents=intents)
TOKEN = 'MTIzODc0MDI5ODU4NzQ0MzIyMA.GVxPIf.6GqL4gl5pmnNfV7jWC7yqR0qGX2P23dbYQpMeI'
@bot.event
async def on_ready():
activity = discord.Game(name="/login")
await bot.change_presence(status=discord.Status.online, activity=activity)
print("Bot is online!")
class Emoji:
DENY = "<a:deny:1066326613014364160>"
CHECKMARK = "<a:checkmark:1066327424536686663>"
WINDOWS = "<:windows:1072644001661976656>"
LOADING = "<a:loading:1125550892859527309>"
WARN = "<:warning:1126156805106565190>"
class Color:
BLUE = 0x44a8fa
RED = 0xfa4459
YELLOW = 0xe8c800
DATABASE_CLUSTER = AsyncIOMotorClient("mongodb://localhost:27017")
db = DATABASE_CLUSTER["Gorb0"]
user_data = db["test"]
import aiohttp
###################################################### UTILS
token_ref = Account_Check['AccessToken']
accountid = Account_Check['AccountId']
return
f"https://fortnite-api.com/images/cosmetics/br/{idavatar}/icon.png"
accountid = Account_Check['AccountId']
deviceId = Account_Check['DeviceId']
secret = Account_Check['Secret']
session = aiohttp.ClientSession()
DataInsert = {
"UserId": user_id,
"AccessToken": access_code,
"AccountId": account_id,
"DisplayName": display_name,
"DeviceId": deviceId,
"Secret": secret
}
###################################################################################
#############################################
#Embed Error(s)
#Reload
else:
await ctx.respond("You are not a dev.", ephemeral=True)
#Login
class Login(discord.ui.Modal):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.add_item(discord.ui.InputText(label="Authorization Code."))
HeaderData = {
"Content-Type": f"application/x-www-form-urlencoded",
"Authorization": f"basic
MzQ0NmNkNzI2OTRjNGE0NDg1ZDgxYjc3YWRiYjIxNDE6OTIwOWQ0YTVlMjVhNDU3ZmI5YjA3NDg5ZDMxM2I
0MWE="
}
LoginData =
f"grant_type=authorization_code&code={self.children[0].value}"
LoginRequest = requests.post("https://account-public-service-
prod.ol.epicgames.com/account/api/oauth/token",headers=HeaderData,data=LoginData)
display_name = LoginRequest.json()['displayName']
accountId = LoginRequest.json()['account_id']
access_code = LoginRequest.json()['access_token']
DataInsert = {
"UserId": interaction.user.id,
"AccessToken": access_code,
"AccountId": accountId,
"DisplayName": display_name,
"DeviceId": device_id,
"Secret": secret
}
await user_data.insert_one(DataInsert)
embed = discord.Embed(
title=f"You are now logged in as, `{display_name}`",
description="You have been added to our databases",
colour= discord.Colour.brand_green()
)
embed.set_thumbnail(url=avatar)
await interaction.response.send_message(embeds=[embed])
except:
await interaction.respond.send_message("Authorization Code
Expired.")
else:
embed = discord.Embed(title="Logged In Already",description=f"You are
already logged in as, `{Data_Check['DisplayName']}`",colour=discord.Colour.green())
await interaction.response.send_message(embeds=[embed])
@discord.ui.button(label="Submit", style=discord.ButtonStyle.green)
async def button_callback(self, button, interaction: discord.Interaction):
modal = Login(title="Authorization Code")
await interaction.response.send_modal(modal)
#Logout Command
if Account_Check is None:
await ctx.respond(embed=NotLoggedIn)
else:
token_ref = Account_Check['AccessToken']
accountid = Account_Check['AccountId']
display_name = Account_Check['DisplayName']
party = response.json()['current']
if party == []:
embed = discord.Embed(title="Error", description="You are not in a
party.", color=discord.Color.red())
await ctx.respond(embed=embed)
else:
party_id = party[0]['id']
url =
f"https://party-service-prod.ol.epicgames.com/party/api/v1/Fortnite/parties/
{party_id}/members/{accountid}"
response = requests.delete(url, headers=headers)
token_ref = account_Check['AccessToken']
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + token_ref,
"Accept-Language": "en"
}
info_url =
"https://fngw-mcp-gc-livefn.ol.epicgames.com/fortnite/api/game/v2/world/info"
async with aiohttp.ClientSession() as session:
async with session.get(info_url, headers=headers) as info_response:
if info_response.status == 200:
data = await info_response.json()
replacements = [
{"searchText": "Blasted Badlands Venture Zone",
"replacementText": "Bot for mission fille dev by jdk"},
await
ctx.respond(file=discord.File(f'mission{current_datetime}.json'))
except Exception as e:
await ctx.send(f"Erreur lors de l'écriture du
fichier : {str(e)}")
else:
await ctx.send("Voici le fichier JSON modifié :",
file=discord.File("modified_data.json"))
url = f"https://fngw-mcp-gc-livefn.ol.epicgames.com/fortnite/api/game/v2/
friendcodes/:{accountid}/{codetype}:"
token_ref = account_Check['AccessToken']
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + token_ref,
"Accept-Language": "en"
}
info_url =
"https://fngw-mcp-gc-livefn.ol.epicgames.com/fortnite/api/game/v2/world/info"
async with aiohttp.ClientSession() as session:
async with session.get(info_url, headers=headers) as info_response:
if info_response.status == 200:
data = await info_response.json()
replacements = [
{"searchText": "EventFlag", "replacementText":
"NotEventFlag"},
{"searchText": "activeQuestDefinitions",
"replacementText": "NotactiveQuestDefinitions"},
{"searchText": "requirements", "replacementText":
"Notrequirements"},
{"searchText":
"/Script/Engine.DataTable'/Game/Balance/DataTables/GameDifficultyGrowthBounds.GameD
ifficultyGrowthBounds'", "replacementText": "powerlevel"},
{"searchText": '"theaterType"\\s*:\\s*"Tutorial"',
"replacementText": '"theaterType": "Standard"'},
{"searchText": '"bHideLikeTestTheater":\\s*true',
"replacementText": '"bHideLikeTestTheater": false'},
{"searchText": '"missionGenerator"\\s*:\\s*"None"',
"replacementText": '"missionGenerator":
"/SaveTheWorld/World/MissionGens/MissionGen_T1_HT_EvacuateTheSurvivors.MissionGen_T
1_HT_EvacuateTheSurvivors_C"'},
{"searchText": '"Theater_Phoenix_Zone02"',
"replacementText": '"Theater_Start_Zone2"'},
{"searchText": '"Theater_Phoenix_Zone03"',
"replacementText": '"Theater_Start_Zone3"'},
{"searchText": '"Theater_Phoenix_Group_Zone03"',
"replacementText": '"Theater_Start_Group_Zone3"'},
{"searchText": '"Theater_Phoenix_Zone05"',
"replacementText": '"Theater_Start_Zone5"'},
{"searchText": '"Theater_Phoenix_Group_Zone05"',
"replacementText": '"Theater_Start_Group_Zone5"'},
{"searchText": '"Theater_Phoenix_Zone07"',
"replacementText": '"Theater_Normal_Zone2"'},
{"searchText": '"Theater_Phoenix_Group_Zone07"',
"replacementText": '"Theater_Normal_Group_Zone2"'},
{"searchText": '"Theater_Phoenix_Zone09"',
"replacementText": '"Theater_Normal_Zone4"'},
{"searchText": '"Theater_Phoenix_Group_Zone09"',
"replacementText": '"Theater_Normal_Group_Zone4"'},
{"searchText": '"Theater_Phoenix_Zone11"',
"replacementText": '"Theater_Hard_Zone1"'},
{"searchText": '"Theater_Phoenix_Group_Zone11"',
"replacementText": '"Theater_Hard_Group_Zone1"'},
{"searchText": '"Theater_Phoenix_Zone13"',
"replacementText": '"Theater_Hard_Zone3"'},
{"searchText": '"Theater_Phoenix_Group_Zone13"',
"replacementText": '"Theater_Hard_Group_Zone3"'},
{"searchText": '"Theater_Phoenix_Zone15"',
"replacementText": '"Theater_Hard_Zone5"'},
{"searchText": '"Theater_Phoenix_Group_Zone15"',
"replacementText": '"Theater_Hard_Group_Zone5"'},
{"searchText": '"Theater_Phoenix_Zone17"',
"replacementText": '"Theater_Nightmare_Zone2"'},
{"searchText": '"Theater_Phoenix_Group_Zone17"',
"replacementText": '"Theater_Nightmare_Group_Zone2"'},
{"searchText": '"Theater_Phoenix_Zone19"',
"replacementText": '"Theater_Nightmare_Zone4"'},
{"searchText": '"Theater_Phoenix_Group_Zone19"',
"replacementText": '"Theater_Nightmare_Group_Zone4"'},
{"searchText": '"Theater_Phoenix_Zone21"',
"replacementText": '"Theater_Endgame_Zone1"'},
{"searchText": '"Theater_Phoenix_Group_Zone21"',
"replacementText": '"Theater_Endgame_Group_Zone1"'},
{"searchText": '"Theater_Phoenix_Zone23"',
"replacementText": '"Theater_Endgame_Zone3"'},
{"searchText": '"Theater_Phoenix_Group_Zone23"',
"replacementText": '"Theater_Endgame_Group_Zone3"'},
{"searchText": '"Theater_Phoenix_Zone25"',
"replacementText": '"Theater_Endgame_Zone5"'},
{"searchText": '"Theater_Phoenix_Group_Zone25"',
"replacementText": '"Theater_Endgame_Group_Zone5"'},
{"searchText": '"theaterSlot"\\s*:\\s*2',
"replacementText": '"theaterSlot": 0'},
{"searchText": "HV3_01", "replacementText":
"Start_Zone4"},
{"searchText": "HV3_02", "replacementText":
"Start_Zone5"},
{"searchText": "HV3_03", "replacementText":
"Normal_Zone2"},
{"searchText": "HV3_04", "replacementText":
"Normal_Zone4"},
{"searchText": "HV3_05", "replacementText":
"Hard_Zone1"},
{"searchText": "HV3_06", "replacementText":
"Hard_Zone3"},
{"searchText": "HV3_07", "replacementText":
"Hard_Zone5"},
{"searchText": "HV3_08", "replacementText":
"Nightmare_Zone2"},
{"searchText": "HV3_09", "replacementText":
"Nightmare_Zone4"},
{"searchText": "HV3_10", "replacementText":
"Endgame_Zone1"},
{"searchText": "HV3_11", "replacementText":
"Endgame_Zone3"},
{"searchText": "HV3_12", "replacementText":
"Endgame_Zone5"},
{"searchText": "_Starlight_Start_Zone2",
"replacementText": "_Start_Zone3"},
{"searchText": "_StarlightTimed_Start_Zone2",
"replacementText": "_Start_Zone3"},
{"searchText": "Theater_Starlight_",
"replacementText": "Theater_"},
{"searchText": "_StarlightTimed_",
"replacementText": "_"},
{"searchText": "Theater_Endless_",
"replacementText": "Theater_"},
{"searchText": "Theater_Mayday_Start_Zone5",
"replacementText": "Theater_Start_Zone5"},
{"searchText": "Theater_Mayday_Normal_Zone3",
"replacementText": "Theater_Normal_Zone3"},
{"searchText": "Theater_Mayday_Normal_Zone5",
"replacementText": "Theater_Normal_Zone5"},
{"searchText": "Theater_Mayday_Hard_Zone3",
"replacementText": "Theater_Hard_Zone3"},
{"searchText": "Theater_Mayday_Hard_Zone5",
"replacementText": "Theater_Hard_Zone5"},
{"searchText": "Theater_Mayday_Nightmare_Zone3",
"replacementText": "Theater_Nightmare_Zone3"},
{"searchText": "Theater_Mayday_Nightmare_Zone5",
"replacementText": "Theater_Nightmare_Zone5"},
{"searchText": "Theater_Mayday_Endgame_Zone5",
"replacementText": "Theater_Endgame_Zone5"},
]
try:
with open('devmission.json', 'w', encoding='utf-8')
as file:
json.dump(updated_data, file,
ensure_ascii=False, indent=2)
await
ctx.respond(file=discord.File('devmission.json'))
except Exception as e:
await ctx.send(f"Erreur lors de l'écriture du
fichier : {str(e)}")
else:
await ctx.send("Voici le fichier JSON modifié :",
file=discord.File("modified_data.json"))
await UpdateInfoAccount(ctx.author.id)
account_id = auth['AccountId']
token_ref = auth['AccessToken']
display_name = auth['DisplayName']
print("v")
headers = {
'Authorization': 'Bearer {0}'.format(token_ref),
'Content-Type': 'application/json'
}
url = f"https://fngw-mcp-gc-livefn.ol.epicgames.com/fortnite/api/game/v2/
profile/{account_id}/{rout}/{operation}?profileId={profile}&rvm=-1"
payload = {
{jsonloadeur}
}
r = requests.post(url, data=json.dumps(payload), headers=headers)
print("v")
if r.status_code == 200:
embed = discord.Embed(description="You can drop an item now and pick it
up.", color=discord.Color.green())
embed.set_author(name=display_name, icon_url=avatar)
await ctx.respond(embed=embed)
data = r.json
current_datetime = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
try:
with open(f'cmpoperation{current_datetime}{display_name}.json', 'w',
encoding='utf-8') as file:
json.dump(data, file, ensure_ascii=False,
indent=2)
await ctx.respond(file=discord.File(f'cmpoperation{current_datetime}
{display_name}.json'))
except Exception as e:
await ctx.send(f"Erreur lors de l'écriture du
fichier : {str(e)}")
else:
await ctx.respond(f'Failed!\n{r.json()['errorMessage']}')
token_ref = account_Check['AccessToken']
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + token_ref,
"Accept-Language": "en"
}
info_url =
"https://fngw-mcp-gc-livefn.ol.epicgames.com/fortnite/api/game/v2/world/info"
async with aiohttp.ClientSession() as session:
async with session.get(info_url, headers=headers) as info_response:
if info_response.status == 200:
data = await info_response.json()
current_datetime = datetime.now().strftime("%Y-%m-%d_
%H-%M-%S")
with open(f'dupfile{current_datetime}.json', 'w') as
file:
json.dump(data, file, indent=4)
await
ctx.respond(file=discord.File(f'dupfile{current_datetime}.json'))
@bot.slash_command(name="ghost-equip", description="Ghost equip")
@commands.cooldown(1, 60, commands.BucketType.user)
async def ghostequip(ctx, skin):
await ctx.defer()
account_Check = await user_data.find_one({"UserId": ctx.author.id})
if account_Check is None:
await ctx.respond(embed=NotLoggedIn)
else:
await UpdateInfoAccount(ctx.author.id)
token_ref = account_Check['AccessToken']
accountid = account_Check['AccountId']
display_name = account_Check['DisplayName']
url = f'https://fortnite-api.com/v2/cosmetics/br/search?name={skin}'
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
if response.status != 200:
else:
headers = {
"Authorization": f"Bearer {token_ref}"
}
url =
f"https://party-service-prod.ol.epicgames.com/party/api/v1/Fortnite/user/
{accountid}"
if currrent == []:
embed = discord.Embed(description='You are not
in a game.', color=discord.Color.red())
embed.set_author(name=display_name,
icon_url=ctx.author.avatar)
await ctx.respond(embed=embed)
else:
partyId = data['current'][0]['id']
data = {
"Default:AthenaCosmeticLoadout_j":
json.dumps({
"AthenaCosmeticLoadout": {
"characterDef":
f"/Game/Athena/Items/Cosmetics/Characters/{id_item}.{id_item}"
}})}
body = {
'delete': [],
'revision': 1,
'update': data
}
url = f"https://party-service-
prod.ol.epicgames.com/party/api/v1/Fortnite/parties/{partyId}/members/{accountid}/
meta"
try:
response = requests.patch(url=url,
headers=headers, json=body)
if response.status_code == 200:
embed = discord.Embed(title="Ghost
Equip", description=f"Succesfully equipped **{name_item}**",
color=discord.Color.green())
embed.set_thumbnail(url=f'https://fortnite-api.com/images/cosmetics/br/
{name_item}/icon.png')
await ctx.respond(embed=embed)
else:
titolo = response.json()['errorCode']
if titolo ==
'errors.com.epicgames.social.party.stale_revision':
mexvars = response.json()
['messageVars']
revision = max(mexvars)
body = {
'delete': [],
'revision': revision,
'update': data
}
url = f"https://party-service-
prod.ol.epicgames.com/party/api/v1/Fortnite/parties/{partyId}/members/{accountid}/
meta"
response = requests.patch(url=url,
headers=headers, json=body)
embed = discord.Embed(title="Ghost
Equip", description=f"Succesfully equipped **{name_item}**",
color=discord.Color.green())
embed.set_thumbnail(url=f'https://fortnite-api.com/images/cosmetics/br/{id_item}/
icon.png')
await ctx.respond(embed=embed)
except requests.exceptions.JSONDecodeError:
#Friends menu
class Panel2(discord.ui.View):
await interaction.response.defer(ephemeral=True)
token_ref = Account_Check['AccessToken']
accountid = Account_Check['AccountId']
display_name = Account_Check['DisplayName']
headers = {
"Authorization": f"Bearer {token_ref}"
}
requests.delete(f"https://friends-public-service-prod.ol.epicgames.com/
friends/api/v1/{accountid}/friends", headers=headers)
cembed = discord.Embed(
title="Successful!",
description=f"Cleared All Friends of {display_name}",
colour=discord.Color.green()
)
await interaction.followup.send(embeds=[cembed])
cembed.set_thumbnail(url=avatar)
token_ref = Account_Check['AccessToken']
accountid = Account_Check['AccountId']
display_name = Account_Check['DisplayName']
headers = {
"Authorization": f"Bearer {token_ref}"
}
deletereq = requests.delete(f"https://friends-public-service-
prod.ol.epicgames.com/friends/api/public/blocklist/{accountid}", headers=headers)
bembed = discord.Embed(
title="Successful!",
description=f"Unblocked All Blocked Users from {display_name}!",
colour=discord.Color.green()
)
await interaction.response.send_message(embeds=[bembed], ephemeral=True)
bembed.set_thumbnail(url=avatar)
if Account_Check is None:
await ctx.respond(embed=NotLoggedIn)
else:
GUI = Panel2()
embed = discord.Embed(
title="Friends List",
description="Click Whichever Button You Want to Do Certain Actions on
the Account Logged in!\n\n[Join Our Support Server For Help]()",
colour=discord.Colour.blue(),
)
await ctx.respond(embed=embed, view=GUI, ephemeral=False)
@bot.slash_command(name="premiumbase",description="crazy glitche")
async def premiumbase(ctx):
await ctx.send(f"PATCH")
from dateutil import parser
if auth is None:
embed = discord.Embed(title=f"Failed", description="You are not logged into
the bot!\nTo log in, run the /login")
embed.set_author(name=ctx.author.name, icon_url=ctx.author.avatar)
embed.set_footer(text="Bot by JDK ")
await ctx.respond(embed=embed)
else:
await UpdateInfoAccount(ctx.author.id)
accountId = auth['AccountId']
accessToken = auth['AccessToken']
url = f"https://account-public-service-prod.ol.epicgames.com/account/api/
public/account/{accountId}"
headers = {
"Authorization": f"Bearer {accessToken}"
}
data = response.json()
accountId = data['id']
displayName = data['displayName']
email = data['email']
country = data['country']
tfaEnabled = data['tfaEnabled']
failedLoginAttempts = data['failedLoginAttempts']
emailVerified = data['emailVerified']
canUpdateDisplayName = data['canUpdateDisplayName']
lastDisplayNameChange = data['lastDisplayNameChange']
numberOfDisplayNameChanges = data['numberOfDisplayNameChanges']
lastLogin = data['lastLogin']
preferredLanguage = data['preferredLanguage']
lastDisplayNameChange = parser.parse(lastDisplayNameChange).strftime("%Y-
%m-%d %H:%M:%S")
lastLogin = parser.parse(lastLogin).strftime("%Y-%m-%d %H:%M:%S")
embed = discord.Embed(color=Color.YELLOW)
embed.add_field(name="Account Externals:", value=f">>> :id: `{accountId}`\
n`{displayName}`", inline=True)
embed.add_field(name="Email:", value=f"> {email} {Emoji.CHECKMARK if
emailVerified == True else Emoji.DENY}", inline=False)
embed.add_field(name="Display Name:", value=f">>> Current: {displayName}\
nLast changed: {lastDisplayNameChange}\nChanges: {numberOfDisplayNameChanges}\
nUpdatable: {Emoji.CHECKMARK if canUpdateDisplayName == True else Emoji.DENY}",
inline=False)
embed.add_field(name="Login:", value=f">>> Failed Login Attempts:
{failedLoginAttempts}\nLast Login: {lastLogin}\nTwo Factor Authentication:
{Emoji.CHECKMARK if tfaEnabled == True else Emoji.DENY}", inline=True)
embed.add_field(name="Country:", value=f"> {country}", inline=False)
embed.add_field(name="Preferred Language:", value=f"> {preferredLanguage}",
inline=False)
embed.set_footer(text="Bot by pepe")
await ctx.respond(embed=embed)
url = f"https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/
matchmaking/session/findPlayer/{accountId}"
headers = {
"Authorization": "Bearer " + accessToken,
"Content-Type": "application/json"
}
if data == []:
return None
return data
@bot.slash_command(
name="dupe",
description="Magic..."
)
async def dupe(ctx):
await ctx.defer()
if auth is None:
embed = discord.Embed(title=f"Failed", description="You are not logged into
the bot!\nTo log in, run the /login")
embed.set_author(name=ctx.author.name, icon_url=ctx.author.avatar)
embed.set_footer(text="Bot by JDK ")
await ctx.respond(embed=embed)
else:
await UpdateInfoAccount(ctx.author.id)
account_id = auth['AccountId']
token_ref = auth['AccessToken']
display_name = auth['DisplayName']
if r.status_code == 200:
embed = discord.Embed(description="You can drop an item now and pick it
up.", color=discord.Color.green())
embed.set_author(name=display_name, icon_url=avatar)
await ctx.respond(embed=embed)
else:
await ctx.respond(f'Failed!\n{r.json()['errorMessage']}')
@bot.event
async def on_application_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
seconds = convert_seconds(error.retry_after)
embed = discord.Embed(title="⛔ Error ⛔", description=f"You are on cooldown
for `{round(seconds, 1)}` seconds.",color=discord.Color.brand_red())
await ctx.respond(embed=embed)
else:
pass
bot.run(TOKEN)