55using System . Text . Json . Serialization ;
66using Microsoft . Extensions . Localization ;
77using CounterStrikeSharp . API . Modules . Commands ;
8+ using CounterStrikeSharp . API . Modules . Cvars ;
89
910namespace NeedSystem ;
1011
@@ -64,6 +65,12 @@ public class BaseConfigs : BasePluginConfig
6465 [ JsonPropertyName ( "EmbedAuthorImage" ) ]
6566 public string EmbedAuthorImage { get ; set ; } = "https://avatars.githubusercontent.com/u/61034981?v=4" ;
6667
68+ [ JsonPropertyName ( "EmbedThumbnail" ) ]
69+ public bool EmbedThumbnail { get ; set ; } = true ;
70+
71+ [ JsonPropertyName ( "EmbedThumbnailImage" ) ]
72+ public string EmbedThumbnailImage { get ; set ; } = "https://avatars.githubusercontent.com/u/61034981?v=4" ;
73+
6774}
6875
6976public class NeedSystemBase : BasePlugin , IPluginConfig < BaseConfigs >
@@ -73,7 +80,7 @@ public class NeedSystemBase : BasePlugin, IPluginConfig<BaseConfigs>
7380 private Translator _translator ;
7481
7582 public override string ModuleName => "NeedSystem" ;
76- public override string ModuleVersion => "1.1.0 " ;
83+ public override string ModuleVersion => "1.1.1 " ;
7784 public override string ModuleAuthor => "luca.uy" ;
7885 public override string ModuleDescription => "Allows players to send a message to discord requesting players." ;
7986
@@ -301,6 +308,10 @@ public void NeedCommand(CCSPlayerController? caller, string clientName)
301308 name = _translator [ "EmbedAuthorName" ] ,
302309 url = Config . EmbedAuthorURL ,
303310 icon_url = Config . EmbedAuthorImage
311+ } : null ,
312+ thumbnail = Config . EmbedThumbnail ? new
313+ {
314+ url = Config . EmbedThumbnailImage ,
304315 } : null
305316 } ;
306317
@@ -349,6 +360,16 @@ private async Task SendEmbedToDiscord(object embed)
349360 }
350361 }
351362
363+ private string GetHostname ( )
364+ {
365+ string hostname = ConVar . Find ( "hostname" ) ? . StringValue ?? _translator [ "NeedInServerMessage" ] ;
366+ if ( string . IsNullOrEmpty ( hostname ) || hostname . Length <= 3 )
367+ {
368+ hostname = _translator [ "NeedInServerMessage" ] ;
369+ }
370+ return hostname ;
371+ }
372+
352373 private string GetWebhook ( )
353374 {
354375 return Config . WebhookUrl ;
0 commit comments