-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Description
When using the /coin command for major cryptocurrencies, the bot returns incorrect names:
/coin BTCreturns "BlackrockTradingCurrency (BTC)" instead of "Bitcoin (BTC)"/coin ETHreturns "The Infinite Garden (ETH)" instead of "Ethereum (ETH)"
This appears to be an issue with how we're querying and handling the CoinGecko API response in the coin command.
Current Behavior
The bot currently:
- Takes the first match from the CoinGecko API response
- Doesn't prioritize or validate major cryptocurrency tickers
- Returns potentially misleading or incorrect information for well-known cryptocurrencies
Expected Behavior
/coin BTCshould return "Bitcoin (BTC)"/coin ETHshould return "Ethereum (ETH)"- Other major cryptocurrencies should return their commonly known names
Relevant Code
The issue likely originates in the coin command implementation:
@commands.slash_command(
name="coin",
description="Gets stats about a cryptocurrency. - usage: /coin <ticker> - example: /coin btc",
)
async def coin(self, inter: disnake.ApplicationCommandInteraction, ticker: str):
# Current implementation doesn't validate or prioritize major cryptocurrencies
coin_data = await fetch_coin_info(ticker)The fetch_coin_info function needs to be modified to either:
- Prioritize major cryptocurrencies
- Use a mapping for common tickers
- Implement better search/matching logic
Possible Solutions
- Create a mapping of major cryptocurrency tickers to their CoinGecko IDs:
MAJOR_COINS = {
"BTC": "bitcoin",
"ETH": "ethereum",
# Add other major coins
}- Modify the fetch_coin_info function to check this mapping first:
async def fetch_coin_info(ticker: str):
ticker = ticker.lower()
if ticker in MAJOR_COINS:
return await coingecko_api.get_coin_by_id(MAJOR_COINS[ticker])
# Fallback to current search logic
return await current_search_implementation(ticker)Additional Context
- This affects user experience as it provides misleading information for the most commonly searched cryptocurrencies
- The current implementation might be pulling data from tokens that share the same ticker symbol
- Priority should be given to established cryptocurrencies over newer tokens with the same ticker
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request

