non__13

add another comand in it /convert {usd($)} to ltc with realtime and most acurate copy able text

Kodari AI
KodariMay 16 at 7:58 am 10,912 (v2)

Iโ€™ll help you add a /convert command that converts USD to LTC with real-time pricing. Let me first check the existing code structure.

Perfect! I can see the bot structure. Iโ€™ll add a /convert command that converts USD to LTC using real-time pricing. The command will display the result in a clean, copyable format.

Perfect! Iโ€™ve added the /convert command to your bot. Hereโ€™s what it does:

New /convert Command Features:

โœ… Real-time conversion - Fetches live LTC prices from CoinGecko API (with fallback) โœ… Accurate results - Shows LTC amount to 8 decimal places for precision โœ… Copyable text - LTC amount displayed in a code block for easy copying โœ… Flexible input - Accepts various formats: 100, $100, 100.50, $1,000.00 โœ… Price info - Shows current LTC price and 24-hour percentage change โœ… Error handling - Validates input and handles API failures gracefully

Usage Examples:

  • /convert usd_amount: 100

  • /convert usd_amount: $50.25

  • /convert usd_amount: 1000

The command displays:

  • Conversion result in bold

  • Current LTC price

  • 24h price change with color indicators (๐ŸŸข up / ๐Ÿ”ด down)

  • Copyable LTC amount in a code block for easy selection

The bot will automatically sync the new command when restarted!

non__13

i just want to cmd like /convert 20 and it converts 20$ to ltc and sends me a copyable output adn ig remove the qr code making feature that adds qr code and removes it cmds too make another cmd /addy so in that way the ltc address you have set gets sended with copyable

Kodari AI
KodariMay 16 at 8:00 am 12,190 (v2)

Iโ€™ll read the current bot files to understand the structure and make the changes you want.

Perfect! Now Iโ€™ll make the changes you requested:

  1. Simplify /convert to just take a number (like /convert 20)

  2. Remove the QR code command

  3. Add /addy command to show your saved LTC address in copyable format

Perfect! Iโ€™ve updated your Discord bot with the changes you requested:

โœ… Changes Made:

1. Simplified /convert command

  • Now just type: /convert 20 (no need for $ symbol)

  • Converts USD to LTC with real-time pricing

  • Shows copyable LTC amount in a code block

  • Clean, simple output

2. Removed QR Code feature

  • Deleted the /qr command completely

  • Removed QR code imports

3. New /addy command

  • Shows your saved LTC address

  • Displays in a copyable code block format

  • Private/ephemeral (only you can see it)

๐Ÿ“‹ Command Usage:

Convert USD to LTC:

Plain Text
/convert 20
/convert 100
/convert 500

Get your address:

Plain Text
/addy

Other existing commands:

  • /set <address> - Set your LTC wallet

  • /bal - Check balance

The bot will automatically sync these changes when you restart it! ๐Ÿš€

Kodari can make mistakes. Review important code before using.
Files
cogs
utils
bot.py
config.json
README.md
requirements.txt
SETUP.md
Code
8 716
bot.py
import discord
from discord.ext import commands
import os
import json
from dotenv import load_dotenv

load_dotenv()

class LitecoinBot(commands.Bot):
    def __init__(self):
        intents = discord.Intents.default()
        intents.message_content = True
        
        super().__init__(
            command_prefix='!',
            intents=intents,
            help_command=None
        )
        
    async def setup_hook(self):
        await self.load_extension('cogs.wallet_commands')
        await self.tree.sync()
        print("Commands synced!")
        
    async def on_ready(self):
        print(f'Bot is ready! Logged in as {self.user.name} ({self.user.id})')
        print(f'Connected to {len(self.guilds)} guilds')
        await self.change_presence(
            activity=discord.Activity(
                type=discord.ActivityType.watching,
                name="LTC Wallets | /bal"
            ),
            status=discord.Status.online
        )

def main():
    if not os.path.exists('data'):
        os.makedirs('data')
    
    if not os.path.exists('data/wallets.json'):
        with open('data/wallets.json', 'w') as f:
            json.dump({}, f)
    
    bot = LitecoinBot()
    
    token = os.getenv('DISCORD_TOKEN')
    if not token:
        print("ERROR: DISCORD_TOKEN not found in .env file!")
        return
    
    bot.run(token)

if __name__ == '__main__':
    main()