bot: Added curl command
All checks were successful
Build Docker / Build Docker (push) Successful in 23s
All checks were successful
Build Docker / Build Docker (push) Successful in 23s
This commit is contained in:
parent
e033f2e137
commit
bb3d517bcd
12
bot.py
12
bot.py
@ -83,6 +83,18 @@ async def dig(ctx, domain: str, record_type: str = "A"):
|
||||
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}")
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user