This commit is contained in:
Anonymous
2023-07-29 23:37:10 +05:30
parent c6c629437c
commit 85f5411b6e
158 changed files with 220479 additions and 4 deletions

24
Helper/TelegramNotify.cs Normal file
View 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)
{
}
}
}