Spaces:
Building
Building
import discord | |
from discord import app_commands | |
from cash import user_cash | |
async def database(interaction: discord.Interaction): | |
if not user_cash: | |
await interaction.response.send_message("fefef.") | |
return | |
content = "\n".join(f"{user_id} cash({amount})" for user_id, amount in user_cash.items()) | |
# Split the content into chunks of 1900 characters to avoid Discord's message limit | |
chunks = [content[i:i+1900] for i in range(0, len(content), 1900)] | |
for i, chunk in enumerate(chunks): | |
if i == 0: | |
await interaction.response.send_message(f" database:\n```\n{chunk}\n```") | |
else: | |
await interaction.followup.send(f"```\n{chunk}\n```") | |