0% found this document useful (0 votes)
4 views23 pages

Discord Bot: Economy & Game Features

This document outlines the code for a Discord bot named Fractal.Bot, which includes features such as user account management, experience points (XP) tracking, and various interactive games like duels and coin flips. It defines user roles, jobs, crime scenarios, and a shop with items that enhance gameplay. The bot operates within a specific channel and includes cooldowns for actions to ensure fair play.

Uploaded by

luisdiannemole
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views23 pages

Discord Bot: Economy & Game Features

This document outlines the code for a Discord bot named Fractal.Bot, which includes features such as user account management, experience points (XP) tracking, and various interactive games like duels and coin flips. It defines user roles, jobs, crime scenarios, and a shop with items that enhance gameplay. The bot operates within a specific channel and includes cooldowns for actions to ensure fair play.

Uploaded by

luisdiannemole
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import discord

from discord import app_commands


from [Link] import commands, tasks
import random
from datetime import datetime, timedelta
import json
import os
import aiohttp
import time
import asyncio

DATA_FILENAME = "fractal_data_v13_en.json"
ALLOWED_CHANNEL_NAME = "cmds"
GUILD_ID = 1401167718111117342

WORK_COOLDOWN_HOURS = 1
DAILY_COOLDOWN_HOURS = 22
CRIME_COOLDOWN_MINUTES = 45
MESSAGE_XP_COOLDOWN_SECONDS = 60

BASE_XP_PER_MESSAGE = (15, 30)


LEVEL_UP_REWARD_MULTIPLIER = 100
WORK_JOBS = [
("Software Developer", 150, 300),
("Taxi Driver", 100, 250),
("Courier", 80, 200),
("Streamer", 200, 400),
("Memeologist", 120, 280),
("Graphic Designer", 180, 350)
]
CRIME_SCENARIOS = [
("Store Robbery", 500, 1500, 0.60),
("Account Hacking", 1000, 3000, 0.45),
("Car Theft", 1500, 5000, 0.35),
("Crypto Scam", 2000, 8000, 0.25)
]

SHOP_ITEMS = {
"Roles": {
"VIP": {"price": 40000, "description": "Show off your status!"},
"Pro Gamer": {"price": 15000, "description": "For the true gaming
enthusiasts."},
"Legend": {"price": 150000, "description": "You have become a part of
server history."},
},
"Boosters": {
"XP Elixir": {"price": 3000, "duration_hours": 1, "effect": "xp_boost",
"multiplier": 2, "description": "Doubles all XP gains for 1 hour."},
"Lucky Clover": {"price": 4300, "duration_hours": 1, "effect":
"luck_boost", "multiplier": 1.15, "description": "Slightly increases win chances &
payouts for 1 hour."},
},
"Consumables": {
"Safety Net": {"price": 25000, "description": "A one-time use item that
prevents coin loss from a single casino game defeat."},
"Case Key": {"price": 3000, "description": "Unlocks a case with a random
reward."}
}
}
SLOT_EMOJIS = { "🍒": {"multiplier": 3, "weight": 25}, "🍋": {"multiplier": 4,
"weight": 20}, "🔔": {"multiplier": 6, "weight": 15}, "💎": {"multiplier": 12,
7️⃣
"weight": 8}, "": {"multiplier": 25, "weight": 4}, " ": {"multiplier": 77,
"weight": 1} }
SLOT_POOL = [emoji for emoji, data in SLOT_EMOJIS.items() for _ in
range(data['weight'])]

ROFL_PHRASES = ["casually summons", "thinks we need more attention from", "sends a


warm welcome to", "wants to introduce everyone to"]
EIGHT_BALL_RESPONSES = ["It is certain.", "Without a doubt.", "You may rely on
it.", "Yes, definitely.", "As I see it, yes.", "Ask again later.", "Cannot predict
now.", "Don't count on it.", "My reply is no.", "Very doubtful."]
HUG_GIFS = ["", "[Link]
"[Link]

intents = [Link]()
intents.message_content = True
[Link] = True
bot = [Link](command_prefix="!", intents=intents, help_command=None)

user_data = {}
message_cooldowns = {}

DEFAULT_ACCOUNT = { "balance": 1000, "last_work": None, "last_daily": None,


"last_crime": None, "total_earned": 0, "total_spent": 0, "games_won": 0,
"games_lost": 0, "xp": 0, "level": 1, "inventory": [], "active_boosts": {} }

def load_data():
global user_data
if [Link](DATA_FILENAME):
try:
with open(DATA_FILENAME, 'r', encoding='utf-8') as f: user_data =
[Link](f)
except [Link]: user_data = {}
else: user_data = {}

def save_data():
with open(DATA_FILENAME, 'w', encoding='utf-8') as f: [Link](user_data, f,
indent=4, ensure_ascii=False)

def get_user_account(user_id):
user_id_str = str(user_id)
if user_id_str not in user_data:
user_data[user_id_str] = DEFAULT_ACCOUNT.copy()
save_data()
else:
for key, value in DEFAULT_ACCOUNT.items():
user_data[user_id_str].setdefault(key, value)
return user_data[user_id_str]

def calculate_xp_for_next_level(level):
return 5 * (level ** 2) + (50 * level) + 100

def get_luck_multiplier(account):
luck_boost = [Link]("active_boosts", {}).get("luck_boost")
if luck_boost and [Link]() <
[Link](luck_boost["end_time"]):
return luck_boost["multiplier"]
return 1.0

async def interaction_check(interaction: [Link]) -> bool:


if [Link] != ALLOWED_CHANNEL_NAME:
await [Link].send_message(f"❌ Commands can only be used in
the #{ALLOWED_CHANNEL_NAME} channel!", ephemeral=True)
return False
return True

@[Link]
async def on_ready():
load_data()
auto_save.start()
[Link].interaction_check = interaction_check
try:
guild_obj = [Link](id=GUILD_ID)
await [Link](guild=guild_obj)
synced = await [Link](guild=guild_obj)
print(f'Synced {len(synced)} commands for server {GUILD_ID}.')
except Exception as e: print(f'Error syncing commands: {e}')
print(f'Bot {[Link]} ([Link]) is online!')
await bot.change_presence(activity=[Link](name="/help or !help |
[Link]"))

@[Link](minutes=5)
async def auto_save(): save_data()

@[Link]
async def on_message(message):
if [Link] or not [Link]: return

if [Link] == ALLOWED_CHANNEL_NAME:
user_id = [Link]
current_time = [Link]()
last_message_time = message_cooldowns.get(user_id)
if not last_message_time or (current_time -
last_message_time).total_seconds() >= MESSAGE_XP_COOLDOWN_SECONDS:
message_cooldowns[user_id] = current_time
account = get_user_account(user_id)
xp_gain = [Link](*BASE_XP_PER_MESSAGE)
xp_boost = [Link]("active_boosts", {}).get("xp_boost")
if xp_boost and [Link]() <
[Link](xp_boost["end_time"]):
xp_gain = int(xp_gain * xp_boost["multiplier"])
account["xp"] += xp_gain
xp_needed = calculate_xp_for_next_level(account["level"])
if account["xp"] >= xp_needed:
account["level"] += 1
account["xp"] -= xp_needed
reward = account["level"] * LEVEL_UP_REWARD_MULTIPLIER
account["balance"] += reward
account["total_earned"] += reward
embed = [Link](title="🎉 LEVEL UP!",
description=f"{[Link]}, you have reached level
**{account['level']}**!\nReward: **{reward}** 🪙", color=[Link]())
try:
await [Link](embed=embed)
except [Link]:
pass
await bot.process_commands(message)

@[Link]
async def on_command_error(ctx, error):
if isinstance(error, [Link]): return
if isinstance(error, [Link]):
await [Link](f"❌ You're missing an argument! Correct usage: `!
{[Link]} {[Link]}`")
elif isinstance(error, ([Link], [Link])):
await [Link]("❌ Invalid argument provided. Please check your spelling and
try again.")
elif isinstance(error, [Link]):
await [Link]("❌ You don't have permission to use this command.")
elif isinstance(error, [Link]) and
isinstance([Link], [Link]):
await [Link]("❌ I don't have the required permissions to perform this
action. Please check my role and channel permissions (e.g., Send Messages, Manage
Roles, Mute Members).")
else:
print(f"An error occurred with a prefix command: {error}")
await [Link]("❌ An unexpected error occurred.")

class DuelView([Link]):
def __init__(self, challenger, opponent, bet):
super().__init__(timeout=60.0)
[Link] = challenger
[Link] = opponent
[Link] = bet
[Link] = None

async def on_timeout(self):


for item in [Link]: [Link] = True
if [Link]: await [Link](content="⏰ The duel challenge
expired.", view=self)

@[Link](label="Accept Duel", style=[Link],


emoji="⚔️")
async def accept(self, interaction: [Link], button:
[Link]):
if [Link] != [Link]:
return await [Link].send_message("❌ This duel is not for
you!", ephemeral=True)

[Link]()
for item in [Link]: [Link] = True

challenger_acc = get_user_account([Link])
opponent_acc = get_user_account([Link])

challenger_power = ([Link](1, 100) + challenger_acc["level"]) *


get_luck_multiplier(challenger_acc)
opponent_power = ([Link](1, 100) + opponent_acc["level"]) *
get_luck_multiplier(opponent_acc)

if challenger_power > opponent_power:


winner, loser, winner_acc, loser_acc = [Link], [Link],
challenger_acc, opponent_acc
else:
winner, loser, winner_acc, loser_acc = [Link], [Link],
opponent_acc, challenger_acc

winner_acc["balance"] += [Link]
winner_acc["games_won"] += 1

if "Safety Net" in loser_acc["inventory"]:


loser_acc["inventory"].remove("Safety Net")
result_description = f"**{[Link]}** has defeated
**{[Link]}** and won **{[Link]:,}** !\n\n🛡️**{[Link]}**'s Safety
Net was used and prevented any coin loss!"
else:
loser_acc["balance"] -= [Link]
result_description = f"**{[Link]}** has defeated
**{[Link]}** and won **{[Link]:,}** 🪙!"

loser_acc["games_lost"] += 1
save_data()

embed = [Link](title="⚔️ Duel Result ⚔️",


color=[Link].dark_red(), description=result_description)
embed.add_field(name=f"{[Link].display_name}'s Power", value=f"💪
{int(challenger_power)}")
embed.add_field(name=f"{[Link].display_name}'s Power", value=f"💪
{int(opponent_power)}")
await [Link].edit_message(embed=embed, view=self)

@[Link](label="Decline", style=[Link])
async def decline(self, interaction: [Link], button:
[Link]):
if [Link] != [Link]:
return await [Link].send_message("❌ This duel is not for
you!", ephemeral=True)
[Link]()
for item in [Link]: [Link] = True
await [Link].edit_message(content=f"🏃
**{[Link].display_name}** has declined the duel.", view=self)

class RussianRouletteView([Link]):
def __init__(self, author):
super().__init__(timeout=30.0)
[Link] = author
[Link] = {author}
[Link] = None

async def on_timeout(self):


for item in [Link]: [Link] = True

if len([Link]) < 2:
return await [Link](content="❌ Not enough players for
Russian Roulette.", view=self)

loser = [Link](list([Link]))

for p in [Link]:
account = get_user_account([Link])
if p == loser: account["games_lost"] += 1
else: account["games_won"] += 1
save_data()
embed = [Link](title="🔫 Russian Roulette 🔫",
color=[Link].dark_red(), description=f"The cylinder spins... 🔄\n...\n**💥
BANG!**\n\nThe loser is **{[Link]}**!")
try:
await [Link](timedelta(minutes=5), reason="Lost Russian
Roulette")
embed.set_footer(text=f"{loser.display_name} has been muted for 5
minutes.")
except [Link]:
embed.set_footer(text="I don't have permissions to mute the loser.")

await [Link](embed=embed, view=self)

@[Link](label="Join", style=[Link], emoji="✋")


async def join(self, interaction: [Link], button:
[Link]):
if [Link] in [Link]:
return await [Link].send_message("❌ You are already in
the game!", ephemeral=True)
[Link]([Link])
await
[Link].edit_message(content=f"**{[Link]}** has
joined the game! **{len([Link])}** players are in.")

class CoinflipView([Link]):
def __init__(self, author, opponent, amount):
super().__init__(timeout=60)
[Link] = author
[Link] = opponent
[Link] = amount
[Link] = None

async def on_timeout(self):


for item in [Link]: [Link] = True
if [Link]: await [Link](content="⏰ Challenge expired.",
view=self)

@[Link](label="Accept", style=[Link],
emoji="✅")
async def accept(self, interaction: [Link], button:
[Link]):
if [Link] != [Link]:
return await [Link].send_message("❌ This challenge is not
for you!", ephemeral=True)
for item in [Link]: [Link] = True
winner, loser = [Link]([[Link], [Link]], 2)
winner_acc, loser_acc = get_user_account([Link]),
get_user_account([Link])

winner_acc["balance"] += [Link]
winner_acc["games_won"] += 1

if "Safety Net" in loser_acc["inventory"]:


loser_acc["inventory"].remove("Safety Net")
result_text = f"The coin was tossed... **{[Link]}** won
**{[Link]}** !\n\n🛡️**{[Link]}**'s Safety Net was used, preventing coin
loss!"
else:
loser_acc["balance"] -= [Link]
result_text = f"The coin was tossed... **{[Link]}** won
**{[Link]}** 🪙!"

loser_acc["games_lost"] += 1
save_data()
embed = [Link](title="🪙 Coinflip 🪙", description=result_text,
color=[Link]())
await [Link].edit_message(content=None, embed=embed,
view=self)

@[Link](label="Decline", style=[Link],
emoji="❌")
async def decline(self, interaction: [Link], button:
[Link]):
if [Link] != [Link]:
return await [Link].send_message("❌ This challenge is not
for you!", ephemeral=True)
for item in [Link]: [Link] = True
await [Link].edit_message(content="❌ Challenge declined.",
view=self)

# SHARED COMMAND LOGIC


async def run_help(source):
embed = [Link](title="✨ [Link] | Command List ✨", color=0x7289DA,
description="Most commands work with both `/` and `!` (e.g., `/work` and `!work`)")
categories = {
"🤣 Fun": ["rofl", "meme", "8ball", "ship", "cat", "dog", "avatar", "hug"],
"💰 Economy & Levels": ["balance", "profile", "leaderboard", "top", "rank",
"work", "daily", "pay", "shop", "buy", "inventory", "use", "stats"],
"🎲 Casino & Games": ["coinflip", "slots", "russian_roulette", "duel",
"dice", "crime"],
"👑 Admin": ["give-money (`!givemoney`)"]
}
for category, cmd_list in [Link]():
cmds = " ".join([f"`/{c}`" for c in cmd_list])
embed.add_field(name=category, value=cmds, inline=False)
return embed

async def run_balance(source, member: [Link] = None):


author = [Link] if isinstance(source, [Link]) else [Link]
target_user = member or author
account = get_user_account(target_user.id)
embed = [Link](title=f"💰 Balance of {target_user.display_name}",
color=[Link]())
[Link] = f"**{account['balance']:,}** 🪙"
return embed

async def run_profile(source, member: [Link] = None):


author = [Link] if isinstance(source, [Link]) else [Link]
target_user = member or author
account = get_user_account(target_user.id)
embed = [Link](title=f"📋 Profile of {target_user.display_name}",
color=target_user.color)
embed.set_thumbnail(url=target_user.display_avatar.url)
embed.add_field(name="💰 Balance", value=f"{account['balance']:,} 🪙")
embed.add_field(name="🏅 Level", value=f"{account['level']}")
embed.add_field(name="✨ XP",
value=f"{account['xp']}/{calculate_xp_for_next_level(account['level'])}")
win_rate = (account['games_won'] / max(1, account['games_won'] +
account['games_lost'])) * 100
embed.add_field(name="🎮 Games Won", value=f"{account['games_won']}")
embed.add_field(name="💔 Games Lost", value=f"{account['games_lost']}")
embed.add_field(name="🎯 Win Rate", value=f"{win_rate:.1f}%")
boosts_text = ""
for boost_type, boost_data in [Link]("active_boosts", {}).items():
end_time = [Link](boost_data["end_time"])
if [Link]() < end_time:
time_left = end_time - [Link]()
hours, remainder = divmod(int(time_left.total_seconds()), 3600)
minutes, _ = divmod(remainder, 60)
boosts_text += f"**{boost_type.replace('_', ' ').title()}**: Active for
{hours}h {minutes}m\n"
if not boosts_text: boosts_text = "None active."
embed.add_field(name="🚀 Active Boosts", value=boosts_text, inline=False)
return embed

async def run_work(user):


account = get_user_account([Link])
last_work_time = [Link]("last_work")
if last_work_time and [Link]() -
[Link](last_work_time) < timedelta(hours=WORK_COOLDOWN_HOURS):
time_left = timedelta(hours=WORK_COOLDOWN_HOURS) - ([Link]() -
[Link](last_work_time))
return f"⏰ You're tired! Come back in **{int(time_left.total_seconds() //
60)}** minutes."

job, min_earn, max_earn = [Link](WORK_JOBS)


earnings = [Link](min_earn, max_earn) + (account["level"] * 5)
account["balance"] += earnings
account["total_earned"] += earnings
account["last_work"] = [Link]().isoformat()
save_data()
embed = [Link](title="💼 Work Complete!", description=f"You worked as a
**{job}** and earned **{earnings}** 🪙!", color=[Link]())
embed.set_thumbnail(url=user.display_avatar.url)
return embed

async def run_daily(user):


account = get_user_account([Link])
last_daily_time = [Link]("last_daily")
if last_daily_time and [Link]() -
[Link](last_daily_time) < timedelta(hours=DAILY_COOLDOWN_HOURS):
time_left = timedelta(hours=DAILY_COOLDOWN_HOURS) - ([Link]() -
[Link](last_daily_time))
hours, rem = divmod(int(time_left.total_seconds()), 3600)
return f"⏰ You've already claimed your daily reward! Come back in
**{hours}h {int(rem // 60)}m**."

earnings = [Link](200, 500) + (account["level"] * 10)


account["balance"] += earnings
account["total_earned"] += earnings
account["last_daily"] = [Link]().isoformat()
save_data()
embed = [Link](title="🎁 Daily Reward!", description=f"You claimed
**{earnings}** 🪙!", color=[Link]())
embed.set_thumbnail(url=user.display_avatar.url)
return embed
async def run_inventory(user):
account = get_user_account([Link])
embed = [Link](title=f"🎒 Inventory of {user.display_name}",
color=[Link]())
if not account["inventory"]: [Link] = "Your inventory is empty."
else: [Link] = "\n".join(f"• {item}" for item in
account["inventory"])
return embed

async def run_use(user, item_name: str):


account = get_user_account([Link])
item_in_inventory = next((item for item in account["inventory"] if [Link]()
== item_name.lower()), None)
if not item_in_inventory: return "❌ You don't have that item in your
inventory."

item_to_use, item_type = None, None


for category, items in SHOP_ITEMS.items():
for name, data in [Link]():
if [Link]() == item_name.lower():
item_to_use, item_type = {"name": name, **data}, category
break
if item_to_use: break

if not item_to_use: return "❌ This item cannot be used."

if item_type == 'Boosters':
effect_type = item_to_use['effect']
if effect_type in [Link]("active_boosts", {}) and [Link]() <
[Link](account["active_boosts"][effect_type]["end_time"]):
return f"❌ A booster of this type is already active!"
end_time = [Link]() +
timedelta(hours=item_to_use['duration_hours'])
account["active_boosts"][effect_type] = {"end_time": end_time.isoformat(),
"multiplier": item_to_use['multiplier']}
account["inventory"].remove(item_in_inventory)
save_data()
return f"🚀 You have activated **{item_to_use['name']}** for
{item_to_use['duration_hours']} hour(s)!"
elif item_type == 'Consumables':
if item_to_use['name'] == "Case Key":
account["inventory"].remove(item_in_inventory)
reward_type = [Link](["coins", "item", "xp"], weights=[70, 10,
20], k=1)[0]
if reward_type == "coins":
amount = [Link](1000, 5000)
account['balance'] += amount
save_data()
return f"🔑 You opened the case and found **{amount:,}** 🪙!"
elif reward_type == "xp":
amount = [Link](500, 2000)
account['xp'] += amount
save_data()
return f"🔑 You opened the case and received **{amount:,}** ✨ XP!"
else:
item = "Safety Net"
account['inventory'].append(item)
save_data()
return f"🔑 You opened the case and found a **{item}**!"
return f"✅ **{item_to_use['name']}** is a passive item. It will be used
automatically when needed."
else:
return "❌ This item cannot be 'used' this way."

async def run_rank(source, member: [Link] = None):


author = [Link] if isinstance(source, [Link]) else [Link]
target_user = member or author
account = get_user_account(target_user.id)
xp_needed = calculate_xp_for_next_level(account['level'])
embed = [Link](title=f"📈 Rank of {target_user.display_name}",
color=target_user.color)
embed.add_field(name="🏅 Level", value=f"**{account['level']}**")
embed.add_field(name="✨ XP", value=f"**{account['xp']} / {xp_needed}**")
progress = int((account['xp'] / max(1, xp_needed)) * 20)
progress_bar = '🟩' * progress + '⬛' * (20 - progress)
embed.add_field(name="📊 Progress", value=f"`{progress_bar}`", inline=False)
return embed

async def run_leaderboard(guild):


sorted_users = sorted(user_data.items(), key=lambda item:
item[1].get('balance', 0), reverse=True)
embed = [Link](title="🏆 Richest Users Leaderboard",
color=[Link]())
description = ""
medals = ["🥇", "🥈", "🥉"]
for i, (user_id, data) in enumerate(sorted_users[:10]):
user = guild.get_member(int(user_id))
if user:
medal = medals[i] if i < 3 else f"`{i+1}.`"
description += f"{medal} **{user.display_name}** —
{data['balance']:,} 🪙\n"
[Link] = description or "The leaderboard is empty..."
return embed

async def run_top(guild):


sorted_users = sorted(user_data.items(), key=lambda item: (item[1].get('level',
0), item[1].get('xp', 0)), reverse=True)
embed = [Link](title="📈 Level Leaderboard", color=[Link]())
description = ""
medals = ["🥇", "🥈", "🥉"]
for i, (user_id, data) in enumerate(sorted_users[:10]):
user = guild.get_member(int(user_id))
if user:
medal = medals[i] if i < 3 else f"`{i+1}.`"
description += f"{medal} **{user.display_name}** — Level
{[Link]('level', 1)}\n"
[Link] = description or "The leaderboard is empty..."
return embed

async def run_dice(user, bet: int, target: int):


if not (2 <= target <= 12): return "❌ Target must be between 2 and 12."
if bet <= 0: return "❌ Bet must be positive."
account = get_user_account([Link])
if account["balance"] < bet: return "❌ You don't have enough coins."

dice1, dice2 = [Link](1, 6), [Link](1, 6)


result = dice1 + dice2
multipliers = {2: 36, 3: 18, 4: 12, 5: 9, 6: 7.2, 7: 6, 8: 7.2, 9: 9, 10: 12,
11: 18, 12: 36}

embed = [Link](title=f"🎲 Dice Roll: The result is {result}!",


color=[Link]())

if result == target:
luck_mult = get_luck_multiplier(account)
winnings = int(bet * multipliers[target] * luck_mult)
account["balance"] += winnings
account["games_won"] += 1
win_desc = f"🎉 **You won!** Your bet on **{target}** paid out
**{winnings:,}** 🪙!"
if luck_mult > 1.0: win_desc += f"\n*Lucky Clover bonus: +{int(winnings -
(bet * multipliers[target])):,} 🪙!*"
[Link] = win_desc
[Link] = [Link]()
else:
if "Safety Net" in account["inventory"]:
account["inventory"].remove("Safety Net")
[Link] = f"💔 **You lost!** You bet on **{target}**, but the
roll was **{result}**.\n Your **Safety Net** was used and you lost no coins!"
[Link] = [Link]()
else:
account["balance"] -= bet
[Link] = f"💔 **You lost!** You bet on **{target}**, but the
roll was **{result}**. You lost **{bet:,}** 🪙."
account["games_lost"] += 1

embed.add_field(name="New Balance", value=f"{account['balance']:,} 🪙")


save_data()
return embed

async def run_buy(guild, user, item_name: str):


account = get_user_account([Link])
item_to_buy, item_type = None, None
for category, items in SHOP_ITEMS.items():
for name, data in [Link]():
if [Link]() == item_name.lower():
item_to_buy, item_type = {"name": name, **data}, category
break
if item_to_buy: break

if not item_to_buy: return "❌ That item does not exist."


if account["balance"] < item_to_buy["price"]: return "❌ You don't have enough
coins!"

account["balance"] -= item_to_buy["price"]
account["total_spent"] += item_to_buy["price"]

if item_type == "Roles":
role = [Link]([Link], name=item_to_buy["name"])
if not role: return f"❌ Role `{item_to_buy['name']}` not found on the
server!"
if role in [Link]: return "❌ You already have this role!"
if [Link].top_role.position <= [Link]:
return f"❌ I can't assign the **{[Link]}** role because it's higher
than my own role in the server's hierarchy."
await user.add_roles(role)
response = f"🎉 You purchased the **{item_to_buy['name']}** role!"
elif item_type in ["Boosters", "Consumables"]:
account["inventory"].append(item_to_buy["name"])
response = f"🎉 You bought a **{item_to_buy['name']}**! Check your
`/inventory`."

save_data()
return response

async def run_crime(user):


account = get_user_account([Link])
last_crime_time = [Link]("last_crime")
if last_crime_time and [Link]() -
[Link](last_crime_time) <
timedelta(minutes=CRIME_COOLDOWN_MINUTES):
time_left = timedelta(minutes=CRIME_COOLDOWN_MINUTES) - ([Link]()
- [Link](last_crime_time))
return f"⏰ Too risky! Try again in **{int(time_left.total_seconds() //
60)}** minutes."

desc, min_r, max_r, chance = [Link](CRIME_SCENARIOS)

embed = [Link](title=f"🚨 Crime: {desc}", color=[Link].dark_red())


embed.set_thumbnail(url=user.display_avatar.url)

if [Link]() < chance:


reward = [Link](min_r, max_r)
account['balance'] += reward
account['games_won'] += 1 # Counting as a 'win'
[Link] = f"✅ **Success!** You pulled it off and earned
**{reward:,}** 🪙!"
[Link] = [Link]()
else:
fine = [Link](min_r // 2, max_r // 2)
if "Safety Net" in account["inventory"]:
account["inventory"].remove("Safety Net")
[Link] = f"👮 **BUSTED!** You were caught, but your **Safety
Net** saved you from the fine!"
[Link] = [Link]()
else:
account['balance'] -= fine
[Link] = f"👮 **BUSTED!** You were caught! You paid a fine of
**{fine:,}** 🪙."
account['games_lost'] += 1

account['last_crime'] = [Link]().isoformat()
embed.add_field(name="New Balance", value=f"{account['balance']:,} 🪙")
save_data()
return embed

# SLASH COMMANDS
@[Link](name="help", description="Shows the list of all commands.")
async def help_slash(interaction: [Link]):
embed = await run_help(interaction)
await [Link].send_message(embed=embed, ephemeral=True)

@[Link](name="balance", description="Shows your or another user's coin


balance.")
@app_commands.describe(member="The user whose balance to check")
async def balance_slash(interaction: [Link], member: [Link] =
None):
embed = await run_balance(interaction, member)
await [Link].send_message(embed=embed)

@[Link](name="profile", description="Displays a user's full game


profile.")
@app_commands.describe(member="The user whose profile to show")
async def profile_slash(interaction: [Link], member: [Link] =
None):
embed = await run_profile(interaction, member)
await [Link].send_message(embed=embed)

@[Link](name="leaderboard", description="Shows the top 10 richest users


on the server.")
async def leaderboard_slash(interaction: [Link]):
embed = await run_leaderboard([Link])
await [Link].send_message(embed=embed)

@[Link](name="top", description="Shows the top 10 highest-level users.")


async def top_slash(interaction: [Link]):
embed = await run_top([Link])
await [Link].send_message(embed=embed)

@[Link](name="rank", description="Shows your level and XP progress.")


@app_commands.describe(member="The user whose rank to check")
async def rank_slash(interaction: [Link], member: [Link] =
None):
embed = await run_rank(interaction, member)
await [Link].send_message(embed=embed)

@[Link](name="work", description="Work to earn coins (cooldown: 1


hour).")
async def work_slash(interaction: [Link]):
result = await run_work([Link])
if isinstance(result, str): await [Link].send_message(result,
ephemeral=True)
else: await [Link].send_message(embed=result)

@[Link](name="daily", description="Claim your daily reward.")


async def daily_slash(interaction: [Link]):
result = await run_daily([Link])
if isinstance(result, str): await [Link].send_message(result,
ephemeral=True)
else: await [Link].send_message(embed=result)

@[Link](name="pay", description="Transfer coins to another user.")


@app_commands.describe(member="Who to pay", amount="How much to pay")
async def pay_slash(interaction: [Link], member: [Link],
amount: int):
if [Link] == [Link] or amount <= 0 or [Link]:
return await [Link].send_message("❌ Invalid transfer
parameters.", ephemeral=True)
sender_account = get_user_account([Link])
if sender_account["balance"] < amount:
return await [Link].send_message("❌ You don't have enough
funds!", ephemeral=True)
receiver_account = get_user_account([Link])
sender_account["balance"] -= amount
receiver_account["balance"] += amount
save_data()
await [Link].send_message(f"💸 {[Link]}
transferred **{amount:,}** 🪙 to {[Link]}!")

@[Link](name="shop", description="Shows the item and role shop.")


async def shop_slash(interaction: [Link]):
embed = [Link](title="🛒 Shop", description="Use `/buy <item_name>` to
purchase.", color=[Link]())
for category, items in SHOP_ITEMS.items():
text = "\n".join([f"**{name}** - {data['price']:,} 🪙\n*└
{data['description']}*" for name, data in [Link]()])
embed.add_field(name=f"--- {category} ---", value=text, inline=False)
await [Link].send_message(embed=embed)

@[Link](name="buy", description="Buy an item from the shop.")


@app_commands.describe(item_name="The name of the item to purchase")
async def buy_slash(interaction: [Link], item_name: str):
response = await run_buy([Link], [Link], item_name)
await [Link].send_message(response, ephemeral=True)

@[Link](name="inventory", description="Shows your inventory.")


async def inventory_slash(interaction: [Link]):
embed = await run_inventory([Link])
await [Link].send_message(embed=embed, ephemeral=True)

@[Link](name="use", description="Use an item from your inventory.")


@app_commands.describe(item_name="The name of the item to use")
async def use_slash(interaction: [Link], item_name: str):
response_message = await run_use([Link], item_name)
await [Link].send_message(response_message, ephemeral=True)

@[Link](name="give-money", description="[Admin Only] Give coins to a


user.")
@app_commands.describe(member="The user to give coins to", amount="The amount to
give")
@app_commands.default_permissions(administrator=True)
async def give_money_slash(interaction: [Link], member:
[Link], amount: int):
if amount <= 0: return await [Link].send_message("❌ Amount must
be positive.", ephemeral=True)
account = get_user_account([Link])
account["balance"] += amount
save_data()
embed = [Link](title="💸 Funds Added", description=f"Admin
{[Link]} has given **{amount:,}** 🪙 to {[Link]}.",
color=[Link]())
await [Link].send_message(embed=embed)

@[Link](name="duel", description="Challenge a user to a duel for coins.")


@app_commands.describe(member="Your opponent", bet="The amount of coins to bet")
async def duel_slash(interaction: [Link], member: [Link], bet:
int):
error_message = await run_duel(interaction, member, bet)
if error_message: await [Link].send_message(error_message,
ephemeral=True)

@[Link](name="russian_roulette", description="Start a game of Russian


Roulette.")
async def russian_roulette_slash(interaction: [Link]):
await run_russian_roulette(interaction)

@[Link](name="hug", description="Give someone a hug.")


@app_commands.describe(member="The person you want to hug")
async def hug_slash(interaction: [Link], member: [Link]):
if member == [Link]: return await
[Link].send_message("You can't hug yourself, but here's one from me
🤗", ephemeral=True)
embed = [Link](description=f"**{[Link].display_name}** gives
**{member.display_name}** a big hug!", color=0xFFC0CB)
embed.set_image(url=[Link](HUG_GIFS))
await [Link].send_message(embed=embed)

@[Link](name="dice", description="Bet on the sum of a two-dice roll (2-


12).")
@app_commands.describe(bet="Your bet amount", target="The number you bet on (2-
12)")
async def dice_slash(interaction: [Link], bet: int, target: int):
result = await run_dice([Link], bet, target)
if isinstance(result, str): await [Link].send_message(result,
ephemeral=True)
else: await [Link].send_message(embed=result)

@[Link](name="rofl", description="Casually summon a random server


member.")
async def rofl_slash(interaction: [Link]):
members = [m for m in [Link] if not [Link]]
target = [Link](members)
await [Link].send_message(f"😂 {[Link]}
{[Link](ROFL_PHRASES)} {[Link]}!")

@[Link](name="meme", description="Get a random meme.")


async def meme_slash(interaction: [Link]):
memes = ["Why don't scientists trust atoms? Because they make up everything!",
"I told my wife she was drawing her eyebrows too high. She looked surprised."]
await [Link].send_message([Link](memes))

@[Link](name="8ball", description="Ask the Magic 8-Ball a question.")


@app_commands.describe(question="Your question for the ball")
async def eightball_slash(interaction: [Link], question: str):
embed = [Link](title="🔮 Magic 8-Ball", color=[Link]())
embed.add_field(name="Your Question", value=question, inline=False)
embed.add_field(name="The Ball's Answer",
value=[Link](EIGHT_BALL_RESPONSES), inline=False)
await [Link].send_message(embed=embed)

@[Link](name="ship", description="Check the compatibility between two


people.")
@app_commands.describe(member1="The first person", member2="The second person")
async def ship_slash(interaction: [Link], member1: [Link],
member2: [Link]):
compatibility = [Link](0, 100)
emoji = "❤️"
if compatibility < 20: emoji = "💔"
elif compatibility < 50: emoji = "😐"
elif compatibility < 80: emoji = "😊"
else: emoji = "💞"
await [Link].send_message(f"Compatibility for {[Link]}
and {[Link]}: **{compatibility}%** {emoji}")

@[Link](name="cat", description="Get a random cat picture.")


async def cat_slash(interaction: [Link]):
await [Link]()
async with [Link]() as session:
async with [Link]('[Link] as
resp:
if [Link] == 200:
data = await [Link]()
embed = [Link](title="🐱 Meow!", color=[Link]())
embed.set_image(url=data[0]['url'])
await [Link](embed=embed)
else:
await [Link]("❌ Could not fetch a cat picture.")

@[Link](name="dog", description="Get a random dog picture.")


async def dog_slash(interaction: [Link]):
await [Link]()
async with [Link]() as session:
async with [Link]('[Link] as resp:
if [Link] == 200:
data = await [Link]()
embed = [Link](title="🐶 Woof!",
color=[Link]())
embed.set_image(url=data['url'])
await [Link](embed=embed)
else:
await [Link]("❌ Could not fetch a dog picture.")

@[Link](name="avatar", description="Show a user's avatar.")


@app_commands.describe(member="The user whose avatar to show")
async def avatar_slash(interaction: [Link], member: [Link] =
None):
target_user = member or [Link]
embed = [Link](title=f" Avatar of {target_user.display_name}",
color=target_user.color)
embed.set_image(url=target_user.display_avatar.url)
await [Link].send_message(embed=embed)

@[Link](name="coinflip", description="Challenge another user to a


coinflip.")
@app_commands.describe(member="Who to play against", amount="The bet amount")
async def coinflip_slash(interaction: [Link], member: [Link],
amount: int):
if [Link] == [Link] or amount <= 0 or [Link]:
return await [Link].send_message("❌ Invalid game
parameters.", ephemeral=True)
p1_acc = get_user_account([Link])
p2_acc = get_user_account([Link])
if p1_acc["balance"] < amount or p2_acc["balance"] < amount:
return await [Link].send_message("❌ One of the players
doesn't have enough funds!", ephemeral=True)
view = CoinflipView([Link], member, amount)
embed = [Link](title="🪙 Coinflip Challenge!",
description=f"{[Link]}, {[Link]} is challenging you to a
coinflip for **{amount:,}** 🪙.", color=[Link]())
await [Link].send_message(embed=embed, view=view)
[Link] = await interaction.original_response()
@[Link](name="slots", description="Play the slot machine.")
@app_commands.describe(bet="Your bet amount")
async def slots_slash(interaction: [Link], bet: int):
if bet <= 0: return await [Link].send_message("❌ Bet must be
positive.", ephemeral=True)
account = get_user_account([Link])
if account["balance"] < bet: return await [Link].send_message("❌
You don't have enough coins.", ephemeral=True)

await [Link]()

reels = [[Link](SLOT_POOL) for _ in range(3)]

initial_embed = [Link](title="🎰 Slots are spinning...",


description=f"[ ❓ | ❓ | ❓ ]", color=[Link]())
message = await [Link](embed=initial_embed)

await [Link](1)
await [Link](embed=[Link](title="🎰 Slots are spinning...",
description=f"[ {reels[0]} | ❓ | ❓ ]", color=[Link]()))
await [Link](1)
await [Link](embed=[Link](title="🎰 Slots are spinning...",
description=f"[ {reels[0]} | {reels[1]} | ❓ ]", color=[Link]()))
await [Link](1)

winnings = 0
win_description = ""

if reels[0] == reels[1] == reels[2]:


luck_mult = get_luck_multiplier(account)
winnings = int(bet * SLOT_EMOJIS[reels[0]]["multiplier"] * luck_mult)
win_description = f"**JACKPOT!** You won **{winnings:,}** 🪙!"
if luck_mult > 1.0: win_description += f"\n*Lucky Clover bonus: +
{int(winnings - (bet * SLOT_EMOJIS[reels[0]]['multiplier'])):,} 🪙!*"
elif reels[0] == reels[1] or reels[1] == reels[2]:
winnings = bet
win_description = f"Two in a row! You get your bet of **{bet:,}** 🪙 back!"

final_embed = [Link]()
result_str = f"[ {reels[0]} | {reels[1]} | {reels[2]} ]"

if winnings > 0:
account["balance"] += winnings
if winnings > bet:
account["balance"] -= bet
account["games_won"] += 1
final_embed.title = "🎉 WINNER! 🎉"
final_embed.description = f"{result_str}\n{win_description}"
final_embed.color = [Link]()
else:
if "Safety Net" in account["inventory"]:
account["inventory"].remove("Safety Net")
final_embed.title = " SAVED! "
final_embed.description = f"{result_str}\n💔 You lost, but your **Safety
Net** was used and you lost no coins!"
final_embed.color = [Link]()
else:
account["balance"] -= bet
final_embed.title = "💔 DEFEAT 💔"
final_embed.description = f"{result_str}\nYou lost **{bet:,}** 🪙."
final_embed.color = [Link]()
account["games_lost"] += 1

final_embed.add_field(name="New Balance", value=f"{account['balance']:,} 🪙")


save_data()
await [Link](embed=final_embed)

@[Link](name="stats", description="Shows server-wide economy


statistics.")
async def stats_slash(interaction: [Link]):
total_balance = sum([Link]('balance', 0) for data in user_data.values())
total_users = len(user_data)
avg_level = sum([Link]('level', 1) for data in user_data.values()) / max(1,
total_users)
embed = [Link](title="📊 Server Statistics",
color=[Link].dark_blue())
embed.add_field(name="👥 Total Players", value=f"{total_users}")
embed.add_field(name="💰 Total Coins in Circulation",
value=f"{total_balance:,} 🪙")
embed.add_field(name="📈 Average Level", value=f"{avg_level:.1f}")
await [Link].send_message(embed=embed)

@[Link](name="crime", description="Commit a risky crime for a big


reward.")
async def crime_slash(interaction: [Link]):
result = await run_crime([Link])
if isinstance(result, str): await [Link].send_message(result,
ephemeral=True)
else: await [Link].send_message(embed=result)

# PREFIX COMMANDS
@[Link](name="help")
async def help_prefix(ctx: [Link]):
embed = await run_help(ctx)
await [Link](embed=embed)

@[Link](name="balance", aliases=["bal"])
async def balance_prefix(ctx: [Link], member: [Link] = None):
embed = await run_balance(ctx, member)
await [Link](embed=embed)

@[Link](name="profile")
async def profile_prefix(ctx: [Link], member: [Link] = None):
embed = await run_profile(ctx, member)
await [Link](embed=embed)

@[Link](name="work")
async def work_prefix(ctx: [Link]):
result = await run_work([Link])
if isinstance(result, str): await [Link](result)
else: await [Link](embed=result)

@[Link](name="daily")
async def daily_prefix(ctx: [Link]):
result = await run_daily([Link])
if isinstance(result, str): await [Link](result)
else: await [Link](embed=result)
@[Link](name="inventory")
async def inventory_prefix(ctx: [Link]):
embed = await run_inventory([Link])
await [Link](embed=embed)

@[Link](name="use")
async def use_prefix(ctx: [Link], *, item_name: str):
response_message = await run_use([Link], item_name)
await [Link](response_message)

@[Link](name="givemoney")
@commands.has_permissions(administrator=True)
async def give_money_prefix(ctx: [Link], member: [Link], amount:
int):
if amount <= 0: return await [Link]("❌ Amount must be positive.")
account = get_user_account([Link])
account["balance"] += amount
save_data()
embed = [Link](title="💸 Funds Added", description=f"Admin
{[Link]} has given **{amount:,}** 🪙 to {[Link]}.",
color=[Link]())
await [Link](embed=embed)

@[Link](name="duel")
async def duel_prefix(ctx: [Link], member: [Link], bet: int):
error_message = await run_duel(ctx, member, bet)
if error_message: await [Link](error_message)

@[Link](name="russian_roulette")
async def russian_roulette_prefix(ctx: [Link]):
await run_russian_roulette(ctx)

@[Link](name="pay")
async def pay_prefix(ctx: [Link], member: [Link], amount: int):
if [Link] == [Link] or amount <= 0 or [Link]:
return await [Link]("❌ Invalid transfer parameters.")
sender_account = get_user_account([Link])
if sender_account["balance"] < amount:
return await [Link]("❌ You don't have enough funds!")
receiver_account = get_user_account([Link])
sender_account["balance"] -= amount
receiver_account["balance"] += amount
save_data()
await [Link](f"💸 {[Link]} transferred **{amount:,}** 🪙 to
{[Link]}!")

@[Link](name="shop")
async def shop_prefix(ctx: [Link]):
embed = [Link](title="🛒 Shop", description="Use `!buy <item_name>` to
purchase.", color=[Link]())
for category, items in SHOP_ITEMS.items():
text = "\n".join([f"**{name}** - {data['price']:,} 🪙\n*└
{data['description']}*" for name, data in [Link]()])
embed.add_field(name=f"--- {category} ---", value=text, inline=False)
await [Link](embed=embed)

@[Link](name="buy")
async def buy_prefix(ctx: [Link], *, item_name: str):
response = await run_buy([Link], [Link], item_name)
await [Link](response)

@[Link](name="stats")
async def stats_prefix(ctx: [Link]):
total_balance = sum([Link]('balance', 0) for data in user_data.values())
total_users = len(user_data)
avg_level = sum([Link]('level', 1) for data in user_data.values()) / max(1,
total_users)
embed = [Link](title="📊 Server Statistics",
color=[Link].dark_blue())
embed.add_field(name="👥 Total Players", value=f"{total_users}")
embed.add_field(name="💰 Total Coins in Circulation",
value=f"{total_balance:,} 🪙")
embed.add_field(name="📈 Average Level", value=f"{avg_level:.1f}")
await [Link](embed=embed)

@[Link](name="rank")
async def rank_prefix(ctx: [Link], member: [Link] = None):
embed = await run_rank(ctx, member)
await [Link](embed=embed)

@[Link](name="top")
async def top_prefix(ctx: [Link]):
embed = await run_top([Link])
await [Link](embed=embed)

@[Link](name="leaderboard")
async def leaderboard_prefix(ctx: [Link]):
embed = await run_leaderboard([Link])
await [Link](embed=embed)

@[Link](name="dice")
async def dice_prefix(ctx: [Link], bet: int, target: int):
result = await run_dice([Link], bet, target)
if isinstance(result, str): await [Link](result)
else: await [Link](embed=result)

@[Link](name="slots")
async def slots_prefix(ctx: [Link], bet: int):
if bet <= 0: return await [Link]("❌ Bet must be positive.")
account = get_user_account([Link])
if account["balance"] < bet: return await [Link]("❌ You don't have enough
coins.")

reels = [[Link](SLOT_POOL) for _ in range(3)]

initial_embed = [Link](title="🎰 Slots are spinning...",


description=f"[ ❓ | ❓ | ❓ ]", color=[Link]())
message = await [Link](embed=initial_embed)

await [Link](1)
await [Link](embed=[Link](title="🎰 Slots are spinning...",
description=f"[ {reels[0]} | ❓ | ❓ ]", color=[Link]()))
await [Link](1)
await [Link](embed=[Link](title="🎰 Slots are spinning...",
description=f"[ {reels[0]} | {reels[1]} | ❓ ]", color=[Link]()))
await [Link](1)
winnings = 0
win_description = ""

if reels[0] == reels[1] == reels[2]:


luck_mult = get_luck_multiplier(account)
winnings = int(bet * SLOT_EMOJIS[reels[0]]["multiplier"] * luck_mult)
win_description = f"**JACKPOT!** You won **{winnings:,}** 🪙!"
if luck_mult > 1.0: win_description += f"\n*Lucky Clover bonus: +
{int(winnings - (bet * SLOT_EMOJIS[reels[0]]['multiplier'])):,} 🪙!*"
elif reels[0] == reels[1] or reels[1] == reels[2]:
winnings = bet
win_description = f"Two in a row! You get your bet of **{bet:,}** 🪙 back!"

final_embed = [Link]()
result_str = f"[ {reels[0]} | {reels[1]} | {reels[2]} ]"

if winnings > 0:
account["balance"] += winnings
if winnings > bet:
account["balance"] -= bet
account["games_won"] += 1
final_embed.title = "🎉 WINNER! 🎉"
final_embed.description = f"{result_str}\n{win_description}"
final_embed.color = [Link]()
else:
if "Safety Net" in account["inventory"]:
account["inventory"].remove("Safety Net")
final_embed.title = " SAVED! "
final_embed.description = f"{result_str}\n💔 You lost, but your **Safety
Net** was used and you lost no coins!"
final_embed.color = [Link]()
else:
account["balance"] -= bet
final_embed.title = "💔 DEFEAT 💔"
final_embed.description = f"{result_str}\nYou lost **{bet:,}** 🪙."
final_embed.color = [Link]()
account["games_lost"] += 1

final_embed.add_field(name="New Balance", value=f"{account['balance']:,} 🪙")


save_data()
await [Link](embed=final_embed)

@[Link](name="rofl")
async def rofl_prefix(ctx: [Link]):
members = [m for m in [Link] if not [Link]]
target = [Link](members)
await [Link](f"😂 {[Link]} {[Link](ROFL_PHRASES)}
{[Link]}!")

@[Link](name="meme")
async def meme_prefix(ctx: [Link]):
memes = ["Why don't scientists trust atoms? Because they make up everything!",
"I told my wife she was drawing her eyebrows too high. She looked surprised."]
await [Link]([Link](memes))

@[Link](name="8ball")
async def eightball_prefix(ctx: [Link], *, question: str):
embed = [Link](title="🔮 Magic 8-Ball", color=[Link]())
embed.add_field(name="Your Question", value=question, inline=False)
embed.add_field(name="The Ball's Answer",
value=[Link](EIGHT_BALL_RESPONSES), inline=False)
await [Link](embed=embed)

@[Link](name="ship")
async def ship_prefix(ctx: [Link], member1: [Link], member2:
[Link]):
compatibility = [Link](0, 100)
emoji = "❤️"
if compatibility < 20: emoji = "💔"
elif compatibility < 50: emoji = "😐"
elif compatibility < 80: emoji = "😊"
else: emoji = "💞"
await [Link](f"Compatibility for {[Link]} and {[Link]}:
**{compatibility}%** {emoji}")

@[Link](name="cat")
async def cat_prefix(ctx: [Link]):
async with [Link]() as session:
async with [Link]('[Link] as
resp:
if [Link] == 200:
data = await [Link]()
embed = [Link](title="🐱 Meow!", color=[Link]())
embed.set_image(url=data[0]['url'])
await [Link](embed=embed)
else:
await [Link]("❌ Could not fetch a cat picture.")

@[Link](name="dog")
async def dog_prefix(ctx: [Link]):
async with [Link]() as session:
async with [Link]('[Link] as resp:
if [Link] == 200:
data = await [Link]()
embed = [Link](title="🐶 Woof!",
color=[Link]())
embed.set_image(url=data['url'])
await [Link](embed=embed)
else:
await [Link]("❌ Could not fetch a dog picture.")

@[Link](name="avatar")
async def avatar_prefix(ctx: [Link], member: [Link] = None):
target_user = member or [Link]
embed = [Link](title=f" Avatar of {target_user.display_name}",
color=target_user.color)
embed.set_image(url=target_user.display_avatar.url)
await [Link](embed=embed)

@[Link](name="hug")
async def hug_prefix(ctx: [Link], member: [Link]):
if member == [Link]: return await [Link]("You can't hug yourself, but
here's one from me 🤗")
embed = [Link](description=f"**{[Link].display_name}** gives
**{member.display_name}** a big hug!", color=0xFFC0CB)
embed.set_image(url=[Link](HUG_GIFS))
await [Link](embed=embed)
@[Link](name="crime")
async def crime_prefix(ctx: [Link]):
result = await run_crime([Link])
if isinstance(result, str): await [Link](result)
else: await [Link](embed=result)

[Link]("MTQxMDczNzU2MDE0NTEwMDk5Mg.GagLf5.mPF_Mkp4BYlXKpKwZTLaqOXL2Noe4KehBCRi8Q")
# Замени на свой токен

You might also like