Skip to content
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0a30565
Being suck on creating a new cmd - open
XyrenTheCoder May 6, 2022
b72ce37
Refine description and exception returns
notsniped May 20, 2022
fee7a6a
Add return after every exception
notsniped May 20, 2022
7207908
Make coin rewards for all 3 lootboxes
notsniped May 20, 2022
ffc63f7
Merge branch 'main' into archisha69-open
notsniped Aug 4, 2022
3143589
Fix `options` slash command argument list
notsniped Aug 5, 2022
95fa9ce
Merge branch 'main' into archisha69-open
notsniped Aug 7, 2022
af0e24b
Merge branch 'main' into archisha69-open
notsniped Aug 8, 2022
0ea9069
Merge branch 'main' into archisha69-open
notsniped Aug 8, 2022
63dacec
Merge branch 'main' into archisha69-open
notsniped Aug 10, 2022
f7125fd
Merge branch 'main' into archisha69-open
notsniped Aug 13, 2022
c494b5d
Merge branch 'main' into archisha69-open
notsniped Aug 14, 2022
fded0af
Merge branch 'main' into archisha69-open
notsniped Aug 14, 2022
39006be
Merge branch 'main' into archisha69-open
notsniped Aug 16, 2022
4f54e5d
Debloat source
notsniped Aug 16, 2022
fe30b62
Merge branch 'main' into archisha69-open
notsniped Aug 17, 2022
512efbb
Merge branch 'main' into archisha69-open
notsniped Aug 21, 2022
d7663b1
Set user warning messages to hidden
notsniped Aug 23, 2022
862ad79
Remove redundant comment
notsniped Aug 23, 2022
d7ef4b3
Make list names more understandable
notsniped Aug 23, 2022
8171237
Fix logic
notsniped Aug 23, 2022
310c978
Add a shorter response for when an unknown lootbox is opened
notsniped Aug 23, 2022
03522fe
Create lootbox item reward lists for `normal`, `large` and `special`
notsniped Aug 23, 2022
22aa762
Merge branch 'main' into archisha69-open
notsniped Aug 23, 2022
7a77ddd
Add code to save and give user lootbox rewards
notsniped Aug 23, 2022
5a3ba27
Merge branch 'archisha69-open' of https://github.com/PyBotDevs/isobot…
notsniped Aug 23, 2022
dc2e548
Add reward embed to bot responses
notsniped Aug 23, 2022
85922d3
Fix incorrectly defined list names in large and special lootbox rewar…
notsniped Aug 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,65 @@ async def dig(ctx:SlashContext):
save()
await ctx.reply('YOU FELL INTO YOUR OWN TRAP AND DIED LMFAO\nYou lost 2000 coins in the process.')

#need help cuz i only got the idea (aka the logic) and not the code detail and stuff
@slash.slash(
name='open',
description='Opens lootbox(es) in your inventory',
options=[
create_option(name='lootbox', description='What lootbox do you want to open?', option_type=3, required=True),
create_option(name='amount', description='How many do you want to open?', option_type=4, required=True)
]
)
async def open(ctx:SlashContext, lootbox:str, amount:int):
types = ["normal", "large", "special"]
if amount <= 0: return await ctx.reply("You can't open 0 or below lootboxes! Don't be stupid.", hidden=True)
if lootbox not in types: return await ctx.reply(f"wtf is {lootbox}?", hidden=True)
ie = shopitem.keys()
normal_loot = [
random.randint(10000, 25000),
random.choice(list(ie)),
random.choice(list(ie))
]
large_loot = [
random.randint(50000, 75000),
random.choice(list(ie)),
random.choice(list(ie)),
random.choice(list(ie))
]
special_loot = [
random.randint(100000, 500000),
random.choice(list(ie)),
random.choice(list(ie)),
random.choice(list(ie)),
random.choice(list(ie)),
random.choice(list(ie))
]
localembed = discord.Embed(title="You opened a lootbox!", description=f"The amazing rewards of your {lootbox} lootbox behold you...", color=discord.Color.gold())
if lootbox == "normal":
currency["wallet"][str(ctx.author.id)] += normal_loot[0]
items[str(ctx.author.id)][normal_loot[1]] += 1
items[str(ctx.author.id)][normal_loot[2]] += 1
localembed.add_field(name="Coins gained", value=f"**{normal_loot[0]}** coins", inline=False)
localembed.add_field(name="Items recieved", value=f"You got **1 {normal_loot[1]}**!\nYou got **1 {normal_loot[2]}**!", inline=False)
if lootbox == "large":
currency["wallet"][str(ctx.author.id)] += large_loot[0]
items[str(ctx.author.id)][large_loot[1]] += 1
items[str(ctx.author.id)][large_loot[2]] += 1
items[str(ctx.author.id)][large_loot[3]] += 1
localembed.add_field(name="Coins gained", value=f"**{large_loot[0]}** coins", inline=False)
localembed.add_field(name="Items recieved", value=f"You got **1 {large_loot[1]}**!\nYou got **1 {large_loot[2]}**!\nYou got **1 {large_loot[3]}**!", inline=False)
if lootbox == "special":
currency["wallet"][str(ctx.author.id)] += special_loot[0]
items[str(ctx.author.id)][special_loot[1]] += 1
items[str(ctx.author.id)][special_loot[2]] += 1
items[str(ctx.author.id)][special_loot[3]] += 1
items[str(ctx.author.id)][special_loot[4]] += 1
items[str(ctx.author.id)][special_loot[5]] += 1
localembed.add_field(name="Coins gained", value=f"**{special_loot[0]}** coins", inline=False)
localembed.add_field(name="Items recieved", value=f"You got **1 {special_loot[1]}**!\nYou got **1 {special_loot[2]}**!\nYou got **1 {special_loot[3]}**!\nYou got **1 {special_loot[4]}**!\nYou got **1 {special_loot[5]}**!", inline=False)
await ctx.send(embed=localembed)
save()

@slash.slash(
name='echo',
description='Sends a bot message in the channel',
Expand Down