Merge pull request 'fix iputils f strings' (#4) from iputils-refactor into main
All checks were successful
Garfbot CI/CD Deployment / Deploy (push) Successful in 15s

Reviewed-on: #4
This commit is contained in:
2025-06-05 23:23:51 +00:00

View File

@ -38,7 +38,7 @@ class IPUtils:
result = subprocess.run( result = subprocess.run(
["ping", "-c", "4", target], capture_output=True, text=True ["ping", "-c", "4", target], capture_output=True, text=True
) )
embed = discord.Embed(title="Ping result: {target}", color=0x4D4D4D, description=f"```{result.stdout}```") embed = discord.Embed(title=f"Ping result: {target}", color=0x4D4D4D, description=f"```{result.stdout}```")
await message.channel.send(embed=embed) await message.channel.send(embed=embed)
except Exception as e: except Exception as e:
await message.channel.send(f"`GarfBot Error: {str(e)}`") await message.channel.send(f"`GarfBot Error: {str(e)}`")
@ -52,7 +52,7 @@ class IPUtils:
result = subprocess.run( result = subprocess.run(
["nslookup", target], capture_output=True, text=True ["nslookup", target], capture_output=True, text=True
) )
embed = discord.Embed(title="NSLookup result: {target}", color=0x4D4D4D, description=f"```{result.stdout}```") embed = discord.Embed(title=f"NSLookup result: {target}", color=0x4D4D4D, description=f"```{result.stdout}```")
await message.channel.send(embed=embed) await message.channel.send(embed=embed)
except Exception as e: except Exception as e:
await message.channel.send(f"`GarfBot Error: {str(e)}`") await message.channel.send(f"`GarfBot Error: {str(e)}`")
@ -66,7 +66,7 @@ class IPUtils:
result = subprocess.run( result = subprocess.run(
["nmap", "-Pn", "-O", "-v", target], capture_output=True, text=True ["nmap", "-Pn", "-O", "-v", target], capture_output=True, text=True
) )
embed = discord.Embed(title="Nmap scan result: {target}", color=0x4D4D4D, description=f"```{result.stdout}```") embed = discord.Embed(title=f"Nmap scan result: {target}", color=0x4D4D4D, description=f"```{result.stdout}```")
embed.set_footer(text="https://nmap.org/") embed.set_footer(text="https://nmap.org/")
await message.channel.send(embed=embed) await message.channel.send(embed=embed)
except Exception as e: except Exception as e: