SuperPenguin Posted March 8, 2020 Share Posted March 8, 2020 Ability to add a discord webhook so when a Task like Server Restart is about to happen a discord webhook could execute. This could be a separate task that is just scheduled before the actual task. Ie: Server is retarting in 10 minutes, 5 minutes, etc... Link to comment Share on other sites More sharing options...
Alexr03 Posted March 8, 2020 Share Posted March 8, 2020 This can be done with custom scripts. import clr clr.AddReference("System.Net") from System.Net import HttpWebRequest, WebRequest from System.Text import Encoding webhookUrl = "WEBHOOK-URL-HERE" name = "NAME-HERE" message = "The server will restart in 5/10/15 minutes. bla bla" data = "{ \"username\": \"" + name + "\", \"content\": \"" + message + "\" }" bytes = Encoding.UTF8.GetBytes(data) webRequest = WebRequest.Create(webhookUrl) request = clr.Convert(webRequest, HttpWebRequest) request.Method = "POST" request.ContentType = "application/json" request.ContentLength = bytes.Length stream = request.GetRequestStream() stream.Write(bytes, 0, bytes.Length) stream.Close() request.GetResponse() 1 Link to comment Share on other sites More sharing options...
SuperPenguin Posted March 8, 2020 Author Share Posted March 8, 2020 Thanks, I'm new to TCAdmin Link to comment Share on other sites More sharing options...
Alexr03 Posted March 8, 2020 Share Posted March 8, 2020 No worries. We're here to help Link to comment Share on other sites More sharing options...
Ebarker Posted November 17, 2021 Share Posted November 17, 2021 Could you show or tell me how to set this up? 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