Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added slash command, updated to latest discord.py, litle rewrite, added requirements.txt, and added my credit forr the help in readme #22

Closed
wants to merge 16 commits into from
Closed
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Loxy-Loxy - Multi-purpose roblox cookie checker (Through a discord bot) - Latest update: 7 Oct 2023
## Loxy-Loxy - Multi-purpose roblox cookie checker (Through a discord bot) - Latest update: 17/07/2024 updated by vincyxiroff
![rblx](https://github.com/DankoOfficial/Loxy-Loxy/assets/99405955/9ae7a077-9e4f-49e7-81d7-18c7dd3e8095)

## Commands
Expand Down
174 changes: 82 additions & 92 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,93 +1,106 @@
from discord import Activity, ActivityType, Embed
import discord
from requests import get
from discord.ext import commands
from datetime import datetime
from time import time as __, sleep as zzz
from re import findall
from discord import app_commands

ec= 0xFF0036

token=""
status="asnathedev on top"
#MY_GUILD = discord.Object(id=0)


def log(text,sleep=None):
print(f"[{datetime.utcfromtimestamp(__()).strftime('%Y-%m-%d %H:%M:%S')}] → {text}")
if sleep: zzz(sleep)

class settings:
token = '' # Discord Bot Token
prefix = '.' # Bot Prefix
bot_status = '@DankoOfficial on Github' # Bot Status
client = commands.Bot(command_prefix=prefix)

log(f'Detected token: {settings.token}',0.5)
log(f'Detected prefix: {settings.prefix}',0.5)
log(f'Detected bot status: {settings.bot_status}',0.5)

@settings.client.event
bot = commands.Bot(command_prefix='dc!', intents=discord.Intents.all())
@bot.event
async def on_ready():
log(f"Connected to {settings.client.user}",0.5)
await settings.client.change_presence(activity=Activity(type=ActivityType.watching, name=settings.bot_status))
log(f"Connected to {bot.user}",0.5)
try:
synced = await bot.tree.sync()
print(f"Synced {len(synced)} commands")
except Exception as e:
print(e)

await bot.change_presence(activity=discord.Activity(name=status, type=2))

@settings.client.command()

@bot.hybrid_command(name="vc", description="Check if the cookie is valid", with_app_commands=True)
async def vc(ctx, cookie=None):
await ctx.defer(ephemeral=True)
if not cookie:
await ctx.send(embed=Embed(title=":x: Missing Cookie", description="", color=0xFF0000))
log(f'User {ctx.author} tried to use {settings.prefix}vc but did not provide a cookie.')
em1 =discord.Embed(color=ec)
em1.add_field(name=":x: Missing Cookie", value="TheBestChecker")
await ctx.send(embed=em1,ephemeral=True)
log(f'User {ctx.author} tried to use /vc but did not provide a cookie.')
return
await ctx.message.delete()
#await ctx.message.delete()
response = get('https://users.roblox.com/v1/users/authenticated',cookies={'.ROBLOSECURITY': cookie})
if '"id":' in response.text:
log(f'User {ctx.author} used {settings.prefix}vc with a valid cookie.')
embedVar = Embed(title=":white_check_mark: Valid Cookie", description="", color=0x38d13b)
embedVar.add_field(name="Passed Cookie: ", value='``` Hidden ```', inline=False)
embedVar.set_footer(text="Check your DMs for the cookie.")
log(f'User {ctx.author} used /vc with a valid cookie.')
em2 = discord.Embed(color=0x38d13b)
em2.add_field(name=":white_check_mark: Valid Cookie", value="check dms")

dm = await ctx.author.create_dm()
await dm.send(embed=Embed(title=":white_check_mark: Cookie", description='```'+cookie+'```', color=0x38d13b))
await ctx.send(embed=embedVar)
await dm.send("------ Cookie Check ------" + "\n" + "```" + cookie + "```" + "\n" + "------ End Cookie Check ------")
await ctx.send(embed=em2, ephemeral=True)
elif 'Unauthorized' in response.text:
log(f'User {ctx.author} used {settings.prefix}vc with an invalid cookie.')
embedVar = Embed(title=":x: Invalid Cookie", description="", color=0xFF0000)
embedVar.add_field(name="Passed Cookie: ", value='``` Hidden ```', inline=False)
await ctx.send(embed=embedVar)
log(f'User {ctx.author} used /vc with an invalid cookie.')
await ctx.send("invalid or not working cookie", ephemeral=True)
else:
log(f'User {ctx.author} used {settings.prefix}vc but roblox returned a bad response.')
embedVar = Embed(title=":x: Error", description="", color=0xFFFF00)
embedVar.add_field(name="Error: ", value='```'+response.text+'```', inline=False)
await ctx.send(embed=embedVar)
log(f'User {ctx.author} used /vc but roblox returned a bad response.')
em4=discord.Embed(color=0xFFFF00)
em4.add_field(name=":x: Error", value='```'+response.text+'```', inline=False)
await ctx.send(embed=em4,ephemeral=True)

@settings.client.command()
@bot.hybrid_command(name='vcr', description="check if cookie is valid + show robux balance", with_app_command=True)
async def vcr(ctx, cookie=None):
await ctx.defer(ephemeral=True)
if not cookie:
await ctx.send(embed=Embed(title=":x: Missing Cookie", description="", color=0xFF0000))
log(f'User {ctx.author} tried to use {settings.prefix}vcr but did not provide a cookie.')
em5=discord.Embed(color=0xFF0000)
em5.add_field(name=":x: Missing Cookie",value="")
await ctx.send(embed=em5,ephemeral=True)
log(f'User {ctx.author} tried to use /vcr but did not provide a cookie.')
return
await ctx.message.delete()
# await ctx.message.delete()
response = get('https://users.roblox.com/v1/users/authenticated',cookies={'.ROBLOSECURITY': cookie})
if '"id":' in response.text:
log(f'User {ctx.author} used {settings.prefix}vcr with a valid cookie.')
log(f'User {ctx.author} used /vcr with a valid cookie.')
user_id = response.json()['id']
robux = get(f'https://economy.roblox.com/v1/users/{user_id}/currency',cookies={'.ROBLOSECURITY': cookie}).json()['robux']
embedVar = Embed(title=":white_check_mark: Valid Cookie", description="", color=0x38d13b)
embedVar.add_field(name="Passed Cookie: ", value='``` Hidden ```', inline=False)
embedVar.add_field(name=":money_mouth: Robux", value=robux, inline=True)
em6=discord.Embed(color=0x38d13b)
em6.add_field(name=":white_check_mark: Valid Cookie", value="")
em6.add_field(name="Passed Cookie: ", value='```Hidden```', inline=False)
em6.add_field(name=":money_mouth: Robux", value=robux, inline=True)
dm = await ctx.author.create_dm()
await dm.send(embed=Embed(title=":white_check_mark: Cookie", description='```'+cookie+'```', color=0x38d13b))
await ctx.send(embed=embedVar)
await dm.send("cookie: " + "\n" + '```' + cookie + '```' + "Robux: " + "\n")
await dm.send("------ VCR ------" + "\n" + '```' + str(robux) + '```' + "\n" + "------ END VCR ------")
await ctx.send(embed=em6, ephemeral=True)
elif 'Unauthorized' in response.text:
log(f'User {ctx.author} used {settings.prefix}vcr with an invalid cookie.')
embedVar = Embed(title=":x: Invalid Cookie", description="", color=0xFF0000)
embedVar.add_field(name="Passed Cookie: ", value='``` Hidden ```', inline=False)
await ctx.send(embed=embedVar)
log(f'User {ctx.author} used /vcr with an invalid cookie.')
await ctx.send("invalid or not working cookie", ephemeral=True)
else:
log(f'User {ctx.author} used {settings.prefix}vcr but roblox returned a bad response.')
embedVar = Embed(title=":x: Error", description="", color=0xFFFF00)
embedVar.add_field(name="Error: ", value='```'+response.text+'```', inline=False)
await ctx.send(embed=embedVar)
log(f'User {ctx.author} used /vcr but roblox returned a bad response.')
em8=discord.Embed(color=0xFFFF00)
em8.add_field(name=":x: Error", value='```'+response.text+'```', inline=False)
await ctx.send(embed=em8,ephemeral=True)


@settings.client.command()
async def full(ctx, cookie=None):
@bot.hybrid_command(name='full', description="display everything about the account", with_app_command=True)
async def full(ctx,cookie=None):
await ctx.defer(ephemeral=True)
if not cookie:
await ctx.send(embed=Embed(title=":x: Missing Cookie", description="", color=0xFF0000))
return
await ctx.message.delete()
emb1=discord.Embed(color=0xFF0000)
emb1.add_field(name=":x: Missing Cookie",value="")
await ctx.send(embed=emb1,ephemeral=True)
# await ctx.message.delete()
response = get('https://users.roblox.com/v1/users/authenticated',cookies={'.ROBLOSECURITY': cookie})
hidden = '``` Hidden ```'
hidden = '```Hidden```'
if '"id":' in response.text:
user_id = response.json()['id']
# -----
Expand All @@ -111,57 +124,34 @@ async def full(ctx, cookie=None):
account_has_pin = account_settings.json()['IsAccountPinEnabled']
account_2step = account_settings.json()['MyAccountSecurityModel']['IsTwoStepEnabled']
# -----
embedVar = Embed(title=":white_check_mark: Valid Cookie", description="", color=0x38d13b)
embedVar.add_field(name="Passed Cookie: ", value=hidden, inline=False)
embedVar.add_field(name=":money_mouth: Robux", value=robux, inline=True)
embedVar.add_field(name=":moneybag: Balance", value=f'{balance_credit} {balance_credit_currency}', inline=True)
embedVar.add_field(name=":bust_in_silhouette: Account Name", value=f'{account_name} ({account_display_name})', inline=True)
embedVar.add_field(name=":email: Email", value=account_email_verified, inline=True)
embedVar.add_field(name=":calendar: Account Age", value=f'{account_age_in_years} years', inline=True)
embedVar.add_field(name=":baby: Above 13", value=account_above_13, inline=True)
embedVar.add_field(name=":star: Premium", value=account_has_premium, inline=True)
embedVar.add_field(name=":key: Has PIN", value=account_has_pin, inline=True)
embedVar.add_field(name=":lock: 2-Step Verification", value=account_2step, inline=True)
emb55 = discord.Embed(color=0x38d13b)
emb55.add_field(name=":white_check_mark: Valid Cookie", value="deam")
emb55.add_field(name=":money_mouth: Robux", value=str(robux) + "\n" + "Has PIN: " + str(account_has_pin) + "\n" + "check dm for other", inline=True)
account_friends = get('https://friends.roblox.com/v1/my/friends/count',cookies={'.ROBLOSECURITY': cookie}).json()['count']
embedVar.add_field(name=":busts_in_silhouette: Friends", value=account_friends, inline=True)
account_voice_verified = get('https://voice.roblox.com/v1/settings', cookies={'.ROBLOSECURITY': cookie}).json()['isVerifiedForVoice']
embedVar.add_field(name=":microphone2: Voice Verified", value=account_voice_verified, inline=True)
account_gamepasses = get(f'https://www.roblox.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber=1&userId={user_id}',cookies={'.ROBLOSECURITY': cookie})
check = findall(r'"PriceInRobux":(.*?),', account_gamepasses.text)
account_gamepasses = str(sum([int(match) if match != "null" else 0 for match in check]))+f' R$'
embedVar.add_field(name=":video_game: Gamepasses Worth", value=account_gamepasses, inline=True)
account_badges = ', '.join(list(findall(r'"name":"(.*?)"',get(f'https://accountinformation.roblox.com/v1/users/{user_id}/roblox-badges',cookies={'.ROBLOSECURITY': cookie}).text)))
embedVar.add_field(name=":medal: Badges", value=account_badges, inline=True)
account_transactions = get(f'https://economy.roblox.com/v2/users/{user_id}/transaction-totals?timeFrame=Year&transactionType=summary',cookies={'.ROBLOSECURITY': cookie}).json()
account_sales_of_goods = account_transactions['salesTotal']
account_purchases_total = abs(int(account_transactions['purchasesTotal']))
account_commissions = account_transactions['affiliateSalesTotal']
account_robux_purchcased = account_transactions['currencyPurchasesTotal']
account_premium_payouts_total = account_transactions['premiumPayoutsTotal']
account_pending_robux = account_transactions['pendingRobuxTotal']
embedVar.add_field(name="**↻** Transactions", value=f':small_red_triangle_down: :small_red_triangle_down: :small_red_triangle_down: ', inline=False)
embedVar.add_field(name=":coin: Sales of Goods", value=account_sales_of_goods, inline=True)
embedVar.add_field(name="💰 Premium Payouts", value=account_premium_payouts_total, inline=True)
embedVar.add_field(name="📈 Commissions", value=account_commissions, inline=True)
embedVar.add_field(name=":credit_card: Robux purchased", value=account_robux_purchcased, inline=True)
embedVar.add_field(name="🚧 Pending", value=account_pending_robux, inline=True)
embedVar.add_field(name=":money_with_wings: Overall", value=account_purchases_total, inline=True)
embedVar.set_thumbnail(url=get(f'https://thumbnails.roblox.com/v1/users/avatar-headshot?size=48x48&format=png&userIds={user_id}').json()['data'][0]['imageUrl'])
dm = await ctx.author.create_dm()
await ctx.send(embed=embedVar)
embedVar.add_field(name="Passed Cookie: ", value=cookie, inline=False)
await dm.send(embed=embedVar)
log(f'User {ctx.author} used {settings.prefix}full with a valid cookie. [{robux} R$ | {balance_credit} {balance_credit_currency} | {account_name} ({account_display_name}) | {account_age_in_years} years | {account_friends} Friends | {account_gamepasses} Gamepasses Worth | {account_badges} Badges | {account_sales_of_goods} Sales of Goods | {account_premium_payouts_total} Premium Payouts | {account_commissions} Commissions | {account_robux_purchcased} Robux Purchased | {account_pending_robux} Pending | {account_purchases_total} Overall | {account_voice_verified} Voice Verified | {account_has_pin} Has PIN | {account_2step} 2-Step Verification | {account_has_premium} Premium | {account_above_13} Above 13 | {account_email_verified} Email | {cookie} Cookie]')
await ctx.send(embed=emb55, ephemeral=True)
await dm.send("```------ Full ------ ```" + "\n" + "Cookie: " + "\n" + "```" + cookie + "```" + "\n" + "Robux: " + str(robux) + "\n" + "Account Name & Display name" + "\n" + account_name + " " + account_display_name + "\n" + "Age in years: " + str(account_age_in_years) + "\n" + "Game pass Worth: " + str(account_gamepasses) + "\n" + "Sales Of Goods" + str(account_sales_of_goods) + "\n" + "Pending Robux" + str(account_pending_robux) + "\n" + "VoiceChat Verified: " + str(account_voice_verified) + "\n" + "Has pin: " + str(account_has_pin) + "\n" + "email: " + account_email_verified + "\n" + "------ End Full ------")

elif 'Unauthorized' in response.text:
log(f'User {ctx.author} used {settings.prefix}full with an invalid cookie.')
embedVar = Embed(title=":x: Invalid Cookie", description="", color=0xFF0000)
embedVar.add_field(name="Passed Cookie: ", value='``` Hidden ```', inline=False)
await ctx.send(embed=embedVar)
log(f'User {ctx.author} used /full with an invalid cookie.')
await ctx.send("invalid or not working cookie", ephemeral=True)
else:
log(f'User {ctx.author} used {settings.prefix}full but roblox returned a bad response.')
embedVar = Embed(title=":x: Error", description="", color=0xFFFF00)
embedVar.add_field(name="Error: ", value='```'+response.text+'```', inline=False)
await ctx.send(embed=embedVar)
log(f'User {ctx.author} used /full but roblox returned a bad response.')
emb3=discord.Embed(color=0xFFFF00)
emb3.add_field(name=":x: Error", value='```'+response.text+'```', inline=False)
await ctx.send(embed=emb3,ephemeral=True)


settings.client.run(settings.token)
bot.run(token)
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
discord
discord.py
requests
datetime