async def handle_cashapp_deposit(interaction: discord.Interaction, amount: float):
cashapp_info = load_json(CASHAPP_INFO_FILE)
user_id = str(interaction.user.id)
if user_id in cashapp_info and cashapp_info[user_id].get('status') not in ['finished', 'confirmed', 'done', 'failed', 'refunded', 'expired', 'cancelled']:
await interaction.response.send_message("โ ๏ธ You already have an ongoing transaction.", ephemeral=True)
return
note = generate_unique_note()
cashtag = "$ephishing"
cashapp_info[user_id] = {
'amount': amount,
'note': note,
'status': 'pending'
}
save_json(CASHAPP_INFO_FILE, cashapp_info)
embed = Embed(
title="CashApp Deposit",
description=f"**Amount:** {amount}\n**Cashtag:** {cashtag}\n**Note:** {note}",
color=discord.Color.blue()
)
embed.set_author(name=interaction.user.name, icon_url=interaction.user.avatar.url)
view = CashAppView(user_id)
await interaction.response.send_message(
embed=embed,
ephemeral=True,
view=view
)
class CashAppView(View):
def __init__(self, user_id: str):
super().__init__()
self.user_id = user_id
@discord.ui.button(label="Check CashApp Payment", style=ButtonStyle.primary)
async def check_payment(self, ask_for_receipt_url, interaction):
await ask_for_receipt_url(interaction)
async def ask_for_receipt_url(interaction: discord.Interaction):
await interaction.response.send_message("Please provide the web receipt URL for your CashApp payment:", ephemeral=True)
def check(msg):
return msg.author == interaction.user and isinstance(msg.channel, discord.TextChannel)
try:
msg = await interaction.client.wait_for('message', check=check, timeout=300)
await handle_receipt_url(msg)
except asyncio.TimeoutError:
await interaction.response.send_message("โฐ You took too long to respond. Please try again.", ephemeral=True)
async def handle_receipt_url(message: discord.Message):
cashapp_info = load_json(CASHAPP_INFO_FILE)
user_id = str(message.author.id)
receipt_url = message.content.strip()
error when I click the button it shows "this interaction failed", in the picture it shows the error code, it sends the embed perfect just button error