Skip to content

Commit

Permalink
v1.5
Browse files Browse the repository at this point in the history
- Added embed footer to lang file
- Added Profile link to embed title
  • Loading branch information
asapverneri committed Sep 16, 2024
1 parent 1af9e08 commit d9db89e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 5 additions & 3 deletions ConnectMSG.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ConnectMSG : BasePlugin, IPluginConfig<ConnectMSGConfig>
public override string ModuleName => "ConnectMSG";
public override string ModuleDescription => "Simple connect/disconnect messages";
public override string ModuleAuthor => "verneri";
public override string ModuleVersion => "1.4";
public override string ModuleVersion => "1.5";

public static Dictionary<ulong, bool> LoopConnections = new Dictionary<ulong, bool>();

Expand Down Expand Up @@ -152,11 +152,12 @@ public async Task SendWebhookMessageAsEmbedConnected(string playerName, ulong st
var embed = new
{
title = $"{Localizer["Discord.ConnectTitle", playerName]}",
url = $"https://steamcommunity.com/profiles/{steamID}",
description = $"{Localizer["Discord.ConnectDescription", country, steamID]}",
color = 65280,
footer = new
{
text = $"ConnectMSG ({ModuleVersion}) by verneri"
text = $"{Localizer["Discord.Footer"]}"
}
};

Expand Down Expand Up @@ -184,11 +185,12 @@ public async Task SendWebhookMessageAsEmbedDisconnected(string playerName, ulong
var embed = new
{
title = $"{Localizer["Discord.DisconnectTitle", playerName]}",
url = $"https://steamcommunity.com/profiles/{steamID}",
description = $"{Localizer["Discord.DisconnectDescription", country, steamID]}",
color = 16711680,
footer = new
{
text = $"ConnectMSG ({ModuleVersion}) by verneri"
text = $"{Localizer["Discord.Footer"]}"
}
};

Expand Down
14 changes: 8 additions & 6 deletions lang/en.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"playerconnect": "{purple}{0} {green}liittyi palvelimelle [{1}]",
"playerdisconnect": "{purple}{0} {red}poistui [{1}]",
"playerwelcomemsg": "Moi {purple}{0}{default}, Tervetuloa {blue}Peliluolan {default}awikka servulle!",
"playerwelcomemsgnextline": "{default}Kirjoittamalla {green}!info {default}näät hyödyllisiä komentoja ;)",
"playerconnect": "{purple}{0} {green}connected [{1}]",
"playerdisconnect": "{purple}{0} {red}disconnected [{1}]",
"playerwelcomemsg": "Hi {purple}{0}{default}, Welcome to {blue}My server{default}. Hope you enjoy!",
"playerwelcomemsgnextline": "{default}Please {green}read our rules{default}.",

"Discord.ConnectTitle": "{0}",
"Discord.ConnectDescription": "liittyi palvelimelle [{0} - {1}]\n[Steam Profiili](https://steamcommunity.com/profiles/{1})",
"Discord.ConnectDescription": "connected [{0} - {1}]\n[Steam](https://steamcommunity.com/profiles/{1})",

"Discord.DisconnectTitle": "{0}",
"Discord.DisconnectDescription": "poistui palvelimelta [{0} - {1}]\n[Steam Profiili](https://steamcommunity.com/profiles/{1})"
"Discord.DisconnectDescription": "disconnected [{0} - {1}]\n[Steam](https://steamcommunity.com/profiles/{1})",

"Discord.Footer": "ConnectMSG (1.5) by verneri"
}

0 comments on commit d9db89e

Please sign in to comment.