Hi!
I am a dev learning how to program. I have followed a tutorial that allows me to use the Revisions view to create a Cloud Script function that will send a Discord message to my channel when there is a new user registration.
I am trying to figure out how to build upon this concept by creating a function that is triggered by the event: player_statistic_changed assigned to fire off the function:
handlers.newScorePosted = function(args){ var contentBody = { "content": "New Score from" + DisplayName + ": " + StatisticValue + "on mission: " + StatisticName + "!" }; var url = "[Redacted URL]"; var method = "post"; var contentType = "application/json"; var headers = {}; var responseString = http.request(url,method,JSON.stringify(contentBody),contentType,headers); }
But I am not receiving any messages in Discord. I'm taking shots in the dark to try and figure out how to pass dynamic content into my message's string.
Any help would be greatly appreciated.
P.S. Would it be possible to determine if the score (value) is in the top-10 of a leaderboard, and only send a Discord message if so?