User Tools

Site Tools


mourn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mourn [2020/03/24 02:13]
mourn
mourn [2020/07/06 03:29] (current)
Line 39: Line 39:
 dosomething() ​   ​ dosomething() ​   ​
 </​code>​ </​code>​
 +** Send Message to Discord Webhook ** 
 +<​code>​ 
 +URI = '​https://​discordapp.com/​...'#​ your webhook url string  
 +alert = '​Testing' ​ ####WHAT TO ALERT 
 +report = "​username="​ + Player.Name + "&​content="​ + alert 
 +PARAMETERS=report 
 +from System.Net import WebRequest 
 +request = WebRequest.Create(URI) 
 +request.ContentType = "​application/​x-www-form-urlencoded"​ 
 +request.Method = "​POST"​ 
 +from System.Text import Encoding 
 +bytes = Encoding.ASCII.GetBytes(PARAMETERS) 
 +request.ContentLength = bytes.Length 
 +reqStream = request.GetRequestStream() 
 +reqStream.Write(bytes,​ 0, bytes.Length) 
 +reqStream.Close() 
 +response = request.GetResponse() 
 +from System.IO import StreamReader 
 +result = StreamReader(response.GetResponseStream()).ReadToEnd().replace('​\r',​ '​\n'​) 
 +</​code>​
 ** Train Skill by Skill Level Example (Magery by Casting)** ** Train Skill by Skill Level Example (Magery by Casting)**
 <​code>​ <​code>​
mourn.txt · Last modified: 2020/07/06 03:29 (external edit)