This commit is contained in:
2026-04-05 00:43:23 +05:30
commit 8be37d3e92
425 changed files with 101853 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
from urllib.parse import quote
class UPIGeneratorTool:
name = "generate_upi_link"
async def execute(self, payee_upi: str, payee_name: str, amount: float, note: str = "") -> dict:
# upi.link is a web-based redirect service that opens any UPI app on mobile.
# This format works as a Telegram inline-button URL (https:// required).
upi_link = f"https://upi.link/{quote(payee_upi, safe='')}?amount={amount:.2f}&cu=INR"
if note:
upi_link += f"&remarks={quote(note)}"
return {
"upi_link": upi_link,
"display_text": f"Pay ₹{amount:,.0f} to {payee_name}",
"payee_upi": payee_upi, "amount": amount
}