XYBERVIRI Posted December 10, 2022 Share Posted December 10, 2022 (edited) I figured out the following to let users send custom messages via scheduled task to their discord for any game with out the use of a bot, using powershell custom actions I used the following custom variables: discord_username, discord_avatarurl, discord_message, discord_webhook $payload = [PSCustomObject]@{ username = $ThisService.Variables.Values["discord_username"] avatar_url = $ThisService.Variables.Values["discord_avatarurl"] content = $ThisService.Variables.Values["discord_message"] } Invoke-RestMethod -Uri $ThisService.Variables.Values["discord_webhook"] -Method Post -Body ($payload | ConvertTo-Json -Depth 100) -ContentType 'application/json' Make sure your variables are set as script parameters: https://help.tcadmin.com/Custom_Scripts#Capture_values_before_executing_the_script Edited December 10, 2022 by XYBERVIRI Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now