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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now