zentabu

upgrade everything make it look better add more stuff add shop add inv add rpg stuff add buttons to most of it all

๐Ÿ“Ž 1 file 334 chars
๐Ÿ“„
players.json
json 16 lines
โ–ถ
{
    "1494102424518922328": {
        "gold": 635,
        "weapon": "Fists",
        "inventory": [],
        "last_daily": "2026-06-13"
    },
    "1493223925012893867": {
        "gold": 310,
        "weapon": "Bow",
        "inventory": [
            "Sword",
            "Bow"
        ],
        "last_daily": "2026-06-13"
    }
Kodari AI
KodariJun 22 at 11:00 pm 19

Iโ€™ll create a comprehensive Discord RPG bot with shop, inventory, combat, and interactive buttons.

DiscordRPGBot
An interactive Discord RPG bot featuring a turn-based combat system, player progression with levels and stats, an equipment system with weapons and armor, a shop with multiple item categories, inventory management, daily rewards, and rich button-based UI. Players can battle enemies, earn gold, purchase gear, level up, and compete with friends in an engaging RPG experience.

โœ… Created a comprehensive Discord RPG Bot with all requested features!

๐ŸŽฎ Features Added:

Interactive Profile System - Rich embeds with 4 action buttons (Inventory, Shop, Battle, Heal)

Multi-Category Shop - Weapons, Armor, and Consumables with dropdown menus and emojis

Complete Inventory System - Equip/unequip items, sell for gold, view organized inventory

Full RPG Combat:

  • 8 different enemies with scaling difficulty

  • Turn-based battle system with attack/item/flee options

  • Critical hits, XP rewards, gold drops

  • Player stats (HP, ATK, DEF) that scale with level

Leveling System - Gain XP from battles, level up for stat increases

Economy - Daily rewards, gold from battles, shop purchases, item selling

Leaderboard - Top 10 players by level and XP

๐Ÿ“‹ Commands:

  • !profile - Main hub with interactive buttons

  • !daily - Claim daily gold (50-150g)

  • !equip <item> - Equip weapons/armor

  • !sell <item> - Sell for 50% value

  • !leaderboard - View top players

  • !help - Command list

๐Ÿš€ Setup:

  1. Replace your_discord_bot_token_here in .env with your actual Discord bot token

  2. Install dependencies: pip install -r requirements.txt

  3. Run: python bot.py

Your existing players.json data is automatically migrated to the new format with enhanced stats! ๐ŸŽŠ

zentabu

add dep all dep half add 1k like that same with with make it all runned buy ! add animated cf slots war bj and add a bal and add a explore

Kodari AI
KodariJun 22 at 11:09 pm 26

โœ… Massive upgrade complete! Added banking, casino games, and exploration system!

๐Ÿ†• New Features:

๐Ÿ’ฐ Banking System

  • !balance / !bal - View wallet, bank, and total balance

  • !deposit <amount> - Deposit gold (supports all, half, 1k, 2.5k, 1m, etc.)

  • !withdraw <amount> - Withdraw gold from bank

  • Bank keeps your gold safe and separate from wallet

๐ŸŽฐ Animated Casino Games

  • !slots <bet> - Animated slot machine with spinning reels!

    • Triple 7s = 10x bet (Jackpot!)

    • Triple ๐Ÿ’Ž = 7x bet

    • Any triple = 5x bet

    • Double match = 2x bet

  • !blackjack <bet> - Interactive blackjack with Hit/Stand buttons!

    • Blackjack pays 2.5x

    • Beat the dealer to win 2x

    • Full animations and proper rules

  • !war <bet> - Animated card war game!

    • Draw cards against the dealer

    • High card wins 2x

    • Tie returns bet

๐Ÿ—บ๏ธ Exploration System

  • !explore - Explore the world! (5 min cooldown)

    • Find gold (50-200g)

    • Discover random items

    • Encounter enemies

    • Sometimes find nothing

๐Ÿ“Š Enhanced Profile

  • Now shows wallet and bank balance

  • Total wealth displayed

  • Updated UI with all new features

๐Ÿ’ก Smart Amount Parsing:

All gold commands support:

  • all - Use all available

  • half - Use half

  • 1k = 1,000

  • 2.5k = 2,500

  • 1m = 1,000,000

  • Regular numbers work too!

Example: !deposit all, !withdraw half, !deposit 5k, !slots 100

Everything runs with ! prefix as requested! ๐ŸŽฎ

zentabu

add all half and 1k to games and add more stuff needed

Kodari can make mistakes. Review important code before using.
Files
bot.py
config.json
requirements.txt
Code
3 1,462
bot.py
import discord
from discord.ext import commands
from discord.ui import Button, View, Select
import json
import os
import random
from datetime import datetime, timedelta
from dotenv import load_dotenv

load_dotenv()

intents = discord.Intents.default()
intents.message_content = True
intents.members = True

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

# Load configuration
with open('config.json', 'r') as f:
    config = json.load(f)

# Load player data
def load_players():
    try:
        with open('players.json', 'r') as f:
            return json.load(f)
    except FileNotFoundError:
        return {}

def save_players(players):
    with open('players.json', 'w') as f:
        json.dump(players, f, indent=4)

def get_player(user_id):
    players = load_players()
    user_id = str(user_id)
    
    if user_id not in players:
        players[user_id] = {
            "gold": 100,
            "bank": 0,
            "weapon": "Fists",
            "armor": "None",
            "inventory": [],
            "last_daily": None,
            "last_explore": None,
            "level": 1,
            "xp": 0,
            "max_hp": 100,
            "current_hp": 100,
            "base_attack": 5,
            "base_defense": 0,
            "active_effects": []
        }
        save_players(players)
    else:
        # Migrate old format to new format
        player = players[user_id]
        if "bank" not in player:
            player["bank"] = 0
        if "armor" not in player:
            player["armor"] = "None"
        if "level" not in player:
            player["level"] = 1
        if "xp" not in player:
            player["xp"] = 0
        if "max_hp" not in player:
            player["max_hp"] = 100
        if "current_hp" not in player:
            player["current_hp"] = 100
        if "base_attack" not in player:
            player["base_attack"] = 5
        if "base_defense" not in player:
            player["base_defense"] = 0
        if "active_effects" not in player:
            player["active_effects"] = []
        if "last_explore" not in player:
            player["last_explore"] = None
        save_players(players)
    
    return players[user_id]

def update_player(user_id, data):
    players = load_players()
    players[str(user_id)] = data
    save_players(players)

def get_weapon_stats(weapon_name):
    if weapon_name == "Fists":
        return 0
    for category in config["shop_items"].values():
        if weapon_name in category:
            return category[weapon_name].get("attack", 0)
    return 0

def get_armor_stats(armor_name):
    if armor_name == "None":
        return 0
    for category in config["shop_items"].values():
        if armor_name in category:
            return category[armor_name].get("defense", 0)
    return 0

def calculate_total_attack(player):
    weapon_attack = get_weapon_stats(player["weapon"])
    return player["base_attack"] + weapon_attack + (player["level"] - 1) * config["level_system"]["attack_per_level"]

def calculate_total_defense(player):
    armor_defense = get_armor_stats(player["armor"])
    return player["base_defense"] + armor_defense + (player["level"] - 1) * config["level_system"]["defense_per_level"]

def xp_for_next_level(level):
    return int(config["level_system"]["base_xp"] * (config["level_system"]["xp_multiplier"] ** (level - 1)))

def check_level_up(player):
    leveled_up = False
    while player["xp"] >= xp_for_next_level(player["level"]):
        player["xp"] -= xp_for_next_level(player["level"])
        player["level"] += 1
        player["max_hp"] += config["level_system"]["hp_per_level"]
        player["current_hp"] = player["max_hp"]
        leveled_up = True
    return leveled_up

def parse_amount(amount_str, player_gold):
    """Parse amount strings like '1k', 'all', 'half'"""
    amount_str = amount_str.lower().strip()
    
    if amount_str == "all":
        return player_gold
    elif amount_str == "half":
        return player_gold // 2
    elif amount_str.endswith("k"):
        try:
            return int(float(amount_str[:-1]) * 1000)
        except:
            return None
    elif amount_str.endswith("m"):
        try:
            return int(float(amount_str[:-1]) * 1000000)
        except:
            return None
    else:
        try:
            return int(amount_str)
        except:
            return None

# Profile View with Buttons
class ProfileView(View):
    def __init__(self, user):
        super().__init__(timeout=180)
        self.user = user
    
    @discord.ui.button(label="View Inventory", style=discord.ButtonStyle.primary, emoji="๐ŸŽ’")
    async def inventory_button(self, interaction: discord.Interaction, button: Button):
        if interaction.user.id != self.user.id:
            await interaction.response.send_message("This is not your profile!", ephemeral=True)
            return
        
        player = get_player(self.user.id)
        embed = discord.Embed(title=f"๐ŸŽ’ {self.user.display_name}'s Inventory", color=discord.Color.blue())
        
        if not player["inventory"]:
            embed.description = "Your inventory is empty!"
        else:
            inventory_text = ""
            for item in player["inventory"]:
                # Find item emoji
                emoji = "๐Ÿ“ฆ"
                for category in config["shop_items"].values():
                    if item in category:
                        emoji = category[item].get("emoji", "๐Ÿ“ฆ")
                        break
                inventory_text += f"{emoji} {item}\n"
            embed.description = inventory_text
        
        embed.set_footer(text="Use !equip <item> to equip weapons or armor")
        await interaction.response.send_message(embed=embed, ephemeral=True)
    
    @discord.ui.button(label="Open Shop", style=discord.ButtonStyle.success, emoji="๐Ÿช")
    async def shop_button(self, interaction: discord.Interaction, button: Button):
        if interaction.user.id != self.user.id:
            await interaction.response.send_message("This is not your profile!", ephemeral=True)
            return
        
        view = ShopCategoryView(self.user)
        embed = discord.Embed(
            title="๐Ÿช Adventure Shop",
            description="Welcome to the shop! Select a category below to browse items.",
            color=discord.Color.gold()
        )
        player = get_player(self.user.id)
        embed.add_field(name="Your Gold", value=f"๐Ÿ’ฐ {player['gold']} gold", inline=False)
        
        await interaction.response.send_message(embed=embed, view=view, ephemeral=True)
    
    @discord.ui.button(label="Battle", style=discord.ButtonStyle.danger, emoji="โš”๏ธ")
    async def battle_button(self, interaction: discord.Interaction, button: Button):
        if interaction.user.id != self.user.id: