def send_embed_to_webhook(user_id, badge_id, badge_name):
embed = {
"title": RobloxAPIs.RobloxGetUsername(user_id),
"url": f"https://www.roblox.com/badges/{badge_id}/badge",
"description": f"{RobloxAPIs.RobloxGetUsername(user_id)} has earned the badge: {badge_name}",
"color": 0x00b0f4,
"timestamp": datetime.datetime.now(datetime.timezone.utc).isoformat(),
"image": {
"url": RobloxAPIs.RobloxGetBadgeImage(badge_id)
},
"thumbnail": {
"url": RobloxAPIs.RobloxGetUserProfileImage(user_id)
}
}
payload = {
"content": "||<@&1220868554669424651>||",
"embeds": [embed]
}
headers = {
'Content-Type': 'application/json'
}
response = requests.post(webhook_url, json=payload, headers=headers)
print(f"Webhook status code: {response.status_code}")
if response.status_code != 204:
print(f"Failed to send embed for user {user_id}. Status code:", response.status_code)
I'm trying to trigger a webhook when something changes on another website. Printing the data works fine, but when attempting to send the webhook, it doesn't go through, despite receiving a 204 status code any help would be appreciated