Skip to content

Commit

Permalink
Правка Вебхука а-чата (#942)
Browse files Browse the repository at this point in the history
Небольшие правки форма текста

no cl, no fun
  • Loading branch information
Schrodinger71 authored Jan 4, 2025
1 parent bd7679b commit 44c7d28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions Content.Server/Administration/Managers/AdminManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public async void DeAdmin(ICommonSession session) // ADT-tweak: add "async"
return;
var payload = new WebhookPayload
{
Content = $"**Снял права**: **{session.Name}**"
Content = $"**Снял права**: `{session.Name}`"
};
var identifier = webhookData.ToIdentifier();
await _discord.CreateMessage(identifier, payload);
Expand Down Expand Up @@ -198,7 +198,7 @@ public async void ReAdmin(ICommonSession session) // ADT-tweak: add "async"
return;
var payload = new WebhookPayload
{
Content = $"**Вернул права**: **{session.Name}**"
Content = $"**Вернул права**: `{session.Name}`"
};
var identifier = webhookData.ToIdentifier();
await _discord.CreateMessage(identifier, payload);
Expand Down Expand Up @@ -407,7 +407,7 @@ private async void DisconnectedAdminMaybe(ICommonSession session)
return;
var payload = new WebhookPayload
{
Content = $"**Оповещение: Админ ВЫШЕЛ {senderName}**"
Content = $"**Оповещение: Админ ВЫШЕЛ** `{senderName}`"
};
var identifier = webhookData.ToIdentifier();
await _discord.CreateMessage(identifier, payload);
Expand Down Expand Up @@ -459,14 +459,11 @@ private async void LoginAdminMaybe(ICommonSession session)
var senderAdmin = GetAdminData(session);
if (senderAdmin == null)
return;
var senderName = session.Name;
if (!string.IsNullOrEmpty(senderAdmin.Title))
senderName += $"\\[{senderAdmin.Title}\\]";
if (await _discord.GetWebhook(webhookUrl) is not { } webhookData)
return;
var payload = new WebhookPayload
{
Content = $"**Оповещение: Админ зашёл {senderName}**"
Content = $"**Оповещение: Админ ЗАШЁЛ** `{session.Name}`[{senderAdmin.Title}]"
};
var identifier = webhookData.ToIdentifier();
await _discord.CreateMessage(identifier, payload);
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ private async void SendAdminChat(ICommonSession player, string message)
return;
var payload = new WebhookPayload
{
Content = $"***AdminChat***: **{senderName}**: {message}"
Content = $"***AdminChat***: `{player.Name}`[{senderAdmin.Title}]: {message}"
};
var identifier = webhookData.ToIdentifier();
await _discord.CreateMessage(identifier, payload);
Expand Down

0 comments on commit 44c7d28

Please sign in to comment.