diff --git a/bot.py b/bot.py index a9723b9..766b3ac 100644 --- a/bot.py +++ b/bot.py @@ -82,6 +82,18 @@ async def dig(ctx, domain: str, record_type: str = "A"): await ctx.response.send_message(f"Domain {domain} not found.") except dns.exception.DNSException as e: await ctx.response.send_message(f"An error occurred: {e}") + +@tree.command(name="curl", description="HTTP request") +async def curl(ctx, url: str): + try: + proxyURL = "https://proxy.hnsproxy.au" + response = requests.get(url, proxies={"http": proxyURL, "https": proxyURL},verify=False) + output = response.text + if (len(output) > 1900): + output = output[:1900] + await ctx.response.send_message(f"Response for {url}:\n{output}") + except requests.exceptions.RequestException as e: + await ctx.response.send_message(f"An error occurred: {e}")