bot: Cleanup logging
All checks were successful
Build Docker / Build Docker (push) Successful in 16s

This commit is contained in:
Nathan Woodburn 2023-09-27 18:35:27 +10:00
parent f611aa929c
commit 7a75c020dc
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

4
bot.py
View File

@ -45,7 +45,6 @@ async def shortlink(ctx, link: str, name: str = None):
if (name == None): if (name == None):
data = {'target' : link} data = {'target' : link}
x = requests.post(url, data = data, headers = headers) x = requests.post(url, data = data, headers = headers)
print(x.text)
if (x.status_code != 200 and x.status_code != 201): if (x.status_code != 200 and x.status_code != 201):
await ctx.response.send_message("ERROR: " + x.text,ephemeral=True) await ctx.response.send_message("ERROR: " + x.text,ephemeral=True)
link=x.json()['link'] link=x.json()['link']
@ -76,10 +75,8 @@ async def dig(ctx, domain: str, record_type: str = "A"):
try: try:
# Query the DNS record # Query the DNS record
response = resolver.resolve(domain, record_type) response = resolver.resolve(domain, record_type)
print(response)
records = "" records = ""
for record in response: for record in response:
print(record)
records = records + "\n" + str(record) records = records + "\n" + str(record)
# Send the result to the Discord channel # Send the result to the Discord channel
@ -172,7 +169,6 @@ async def ssl(ctx, domain: str):
s_client_process = subprocess.Popen(s_client_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) s_client_process = subprocess.Popen(s_client_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
s_client_output, _ = s_client_process.communicate(input=b"\n") s_client_output, _ = s_client_process.communicate(input=b"\n")
print(s_client_output.decode("utf-8"), flush=True)
certificates = [] certificates = []
current_cert = "" current_cert = ""