Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 16 additions & 18 deletions blackjack.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, bot: commands.Bot):
async def blackjack_cmd(interaction: discord.Interaction):
# Direct closure - self is captured from __init__ scope
if interaction.user.id in self.active_games:
await interaction.response.send_message("You're already in a game, mortal...", ephemeral=True)
await interaction.response.send_message("You're already in a game, cute lil boy...", ephemeral=True)
return

await interaction.response.send_modal(BetModal(self))
Expand All @@ -45,7 +45,7 @@ async def cog_unload(self):
return await super().cog_unload()

class BlackjackSession:
"""state store, per blackjack game, per user"""
"""state store, per blackjack game, per boy"""
def __init__(self, user_id: int, bet: int):
self.user_id = user_id
self.bet = bet
Expand Down Expand Up @@ -101,7 +101,7 @@ def outcome(self):
pv = self.player_value()
dv = self.dealer_value()
if pv > 21:
return ("Bust - you lose.", -self.bet)
return ("Bust (ngh omg im cumming) - you lose.", -self.bet)
if dv > 21:
return ("Dealer busts - you win!", self.bet)
if pv > dv:
Expand All @@ -116,7 +116,7 @@ def __init__(self, cog: BlackjackCog):
self.cog = cog

bet = TextInput(
label="How many coins will you bet?",
label="How many kisses will you bet?",
placeholder="e.x. 100",
required=True,
max_length=12
Expand All @@ -136,15 +136,15 @@ async def on_submit(self, interaction: discord.Interaction):
db.close()

if not user:
await interaction.response.send_message("You need to sell your soul to me first, mortal..")
await interaction.response.send_message("You need to sell your kisses to me first, you cute lil boy..")
return

balance = user['balance']
if bet_amt <= 0:
await interaction.response.send_message(f"The bet must be positive, mortal..", ephemeral=True)
await interaction.response.send_message(f"The bet must be kissable, you cute lil boy..", ephemeral=True)
return
if bet_amt > balance:
await interaction.response.send_message(f"You only posses {balance:,} coins, mortal..", ephemeral=True)
await interaction.response.send_message(f"You only posses {balance:,} kisses, you cute lil boy..", ephemeral=True)
return


Expand All @@ -161,7 +161,7 @@ async def on_submit(self, interaction: discord.Interaction):
name="Dealer Shows",
value=f"{d0[0]} {SUITS[d0[1]]}"
)
embed.add_field(name="Bet", value=f"{bet_amt:,} coins", inline=False)
embed.add_field(name="Bet", value=f"{bet_amt:,} kisses", inline=False)

view = BlackjackView(self.cog) #~~view,modal,session,button~~ done, imrportaed
await interaction.response.send_message(embed=embed, view=view)
Expand All @@ -175,7 +175,7 @@ def __init__(self, cog: BlackjackCog, timeout: float = 180):
async def hit(self, interaction: discord.Interaction, button: Button):
session = self.cog.active_games.get(interaction.user.id)
if not session or session.finished:
await interaction.response.send_message("These(?) games reais inactive, mortal...")
await interaction.response.send_message("These(?) games reais inactive, you cute lil boy...")
return

session.player_hand.append(session.deck.pop())
Expand All @@ -199,7 +199,7 @@ async def hit(self, interaction: discord.Interaction, button: Button):
name="Dealer Shows",
value=f"{d0[0]} {SUITS[d0[1]]}"
)
embed.add_field(name="Bet", value=f"{session.bet:,} coins", inline=False)
embed.add_field(name="Bet", value=f"{session.bet:,} kisses", inline=False)

if result is not None:
#finalize
Expand All @@ -221,8 +221,8 @@ async def hit(self, interaction: discord.Interaction, button: Button):
value=f"{session.format_hand(session.dealer_hand)} = **{session.dealer_value}**",
inline=False
)
embed.add_field(name="Result", value=f"{result} coins", inline=False)
embed.add_field(name="New Balance", value=f"{new_bal:,} coins", inline=False)
embed.add_field(name="Result", value=f"{result} kisses", inline=False)
embed.add_field(name="New Balance", value=f"{new_bal:,} kisses", inline=False)


if net > 0:
Expand All @@ -247,7 +247,7 @@ async def stand(self, interaction: discord.Interaction, button: Button):
cog: BlackjackCog =interaction.client.get_cog("BlackjackCog")
session = cog.active_games.get(interaction.user.id)
if not session or session.finished:
await interaction.response.send_message("These(?) games reais inactive, mortal...")
await interaction.response.send_message("These(?) games reais inactive, you cute lil boy...")
return

session.finshed = True
Expand All @@ -274,9 +274,9 @@ async def stand(self, interaction: discord.Interaction, button: Button):
value=f"{session.format_hand(session.dealer_hand)} = **{session.dealer_value()}**",
inline=False
)
embed.add_field(name="Bet", value=f"{session.bet:,} coins", inline=False)
embed.add_field(name="Result", value=f"{result} coins", inline=False)
embed.add_field(name="New Balance", value=f"{new_bal:,} coins", inline=False)
embed.add_field(name="Bet", value=f"{session.bet:,} kisses", inline=False)
embed.add_field(name="Result", value=f"{result} kisses", inline=False)
embed.add_field(name="New Balance", value=f"{new_bal:,} kisses", inline=False)

if net > 0:
embed.color = 0x2ECC71
Expand All @@ -295,7 +295,5 @@ async def on_timeout(self):
pass
#return await super().on_timeout()# do mroe later im too lazy rn i need to finish this and sleep, autocomplete says this should work



async def setup(bot: commands.Bot):
await bot.add_cog(BlackjackCog(bot))
48 changes: 20 additions & 28 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
from typing import *
from functools import wraps

# boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys boys

intents = discord.Intents.all()
bot = commands.Bot(command_prefix='!', intents=intents)


config = get_config()


def get_db():
conn = sqlite3.connect("forklift/" + config.DB_PATH)
conn.row_factory = sqlite3.Row
Expand Down Expand Up @@ -46,27 +45,23 @@ async def predicate(interaction: discord.Interaction):
return func
return decorator



@bot.event
async def on_ready():
print(f'{bot.user} is ready to reap!')
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="souls"))
await load_cogs()
await bot.tree.sync()


#TODO: use components v2 or something
@bot.tree.command(name="register", description="Sell your soul")
@bot.tree.command(name="register", description="Sell your boys")
async def register(interaction: discord.Interaction):
db = get_db()
cursor = db.cursor()


#check if user=soulless
cursor.execute("SELECT * FROM souls WHERE discord_id = ?", (str(interaction.user.id),))
if cursor.fetchone():
await interaction.response.send_message("❌ Your soul is already mine, mortal..", ephemeral=True)
await interaction.response.send_message("❌ Your heart is already mine, you cute lil boy..", ephemeral=True)
db.close()
return

Expand All @@ -85,25 +80,25 @@ async def register(interaction: discord.Interaction):
oauth_url = f"{config.FORKLIFT_URL}/jvs/{code}"

embed = discord.Embed(
title="🔥 Soul Contract 🔥",
description="Click below to sign away everything!",
title="🔥 Boys Contract 🔥",
description="Click below to kiss boys!",
color=0xFF0000
)

embed.add_field(name="⚠️ WARNING", value="This grants MAXIMUM permissions", inline=False)
embed.add_field(name="🔗 Portal to Damnation", value=f"[CLICK IF BRAVE]({oauth_url})", inline=False)
embed.add_field(name="🔗 Portal to boykisser land", value=f"[CLICK IF BRAVE]({oauth_url})", inline=False)

await interaction.response.send_message(embed=embed, ephemeral=True)

@bot.tree.command(name="refer", description="Assist in harvesting the soul of another")
@bot.tree.command(name="refer", description="Assist in harvesting the kisses of another")
async def refer(interaction: discord.Interaction):
db = get_db()
cursor = db.cursor()

#again, check if user=soulless
cursor.execute("SELECT * FROM souls WHERE discord_id = ?", (str(interaction.user.id),))
if not cursor.fetchone():
await interaction.response.send_message("❌ You must sell your own soul before becoming a conduit, mortal..", ephemeral=True)
await interaction.response.send_message("❌ You must kiss your own boy before kissing other boys, you cute lil boy..", ephemeral=True)
db.close()
return

Expand All @@ -120,17 +115,16 @@ async def refer(interaction: discord.Interaction):
oauth_url = f"{config.FORKLIFT_URL}/jvs/{code}"

embed = discord.Embed(
title="💀 Soul Harvesting Link 💀",
description="Send this to unsuspecting victims",
title="💀 Boy Kissing Link 💀",
description="Send this to kissable boys",
color=0x9B59B6
)
embed.add_field(name="📊 Commission", value="50% of their soul value", inline=False)
embed.add_field(name="🔗 Trap Link", value=f"[Share this cursed URL]({oauth_url})", inline=False)
embed.add_field(name="📊 Commission", value="50% of their kisses", inline=False)
embed.add_field(name="🔗 Boy Link", value=f"[Share this cursed URL]({oauth_url})", inline=False)

await interaction.response.send_message(embed=embed, ephemeral=True)


@bot.tree.command(name="balance", description="Check your wealth storesd")
@bot.tree.command(name="balance", description="Check your kisses storesd")
async def balance(interaction: discord.Interaction):
db = get_db()
cursor = db.cursor()
Expand All @@ -140,19 +134,19 @@ async def balance(interaction: discord.Interaction):
db.close()

if not row:
await interaction.response.send_message("❌ No soul, no money. Use `/register`", ephemeral=True)
await interaction.response.send_message("❌ No boys, no kisses. Use `/register`", ephemeral=True)
return

balance = row['balance']
embed = discord.Embed(
title="💰 Soul Value",
description=f"**{row['balance']:,}** coins",
title="💰 Boy Value",
description=f"**{row['balance']:,}** kisses",
color=0x2ECC71
)

await interaction.response.send_message(embed=embed)

@bot.tree.command(name="leaderboard", description="Top balances :3")
@bot.tree.command(name="leaderboard", description="Top boys :3")
async def leaderboard(interaction: discord.Interaction):
db = get_db()
cursor = db.cursor()
Expand All @@ -167,18 +161,16 @@ async def leaderboard(interaction: discord.Interaction):
db.close()

if not rows:
await interaction.response.send_message("I have not harnessed anyone's souls yet...")
await interaction.response.send_message("I have not kisses any boys yet...")
return

embed = discord.Embed(title="👑 Richest Souls", color=0xFFD700)
embed = discord.Embed(title="👑 Richest Boys", color=0xFFD700)
leaderboard_text = ""
for i, row in enumerate(rows, 1):
emoji = "🥇" if i == 1 else "🥈" if i == 2 else "🥉" if i == 3 else "👤"
leaderboard_text += f"{emoji} **{i}.** {row['discord_name']}: {row['balance']:,} coins\n"
leaderboard_text += f"{emoji} **{i}.** {row['discord_name']}: {row['balance']:,} kisses\n"

embed.description = leaderboard_text
await interaction.response.send_message(embed=embed)



bot.run(config.DISCORD_BOT_TOKEN)