File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using System . Threading ;
1+ using System . Diagnostics ;
2+ using System . Reflection ;
3+ using System . Threading ;
24using System . Threading . Tasks ;
35using DSharpPlus ;
46using DSharpPlus . Entities ;
@@ -43,7 +45,23 @@ private async Task ConnectToGateway()
4345 {
4446 string commandPrefix = _options . CommandPrefix ;
4547
46- var activity = new DiscordActivity ( $ "\" { commandPrefix } help\" for help", DiscordActivityType . Playing ) ;
48+ string ? productVersion =
49+ FileVersionInfo . GetVersionInfo ( Assembly . GetExecutingAssembly ( ) . Location ) . ProductVersion ;
50+
51+ var versionString = "?.?.?" ;
52+
53+ if ( ! string . IsNullOrWhiteSpace ( productVersion ) )
54+ {
55+ const int gitFullShaLength = 40 ;
56+
57+ versionString = productVersion . Length > gitFullShaLength
58+ ? productVersion [ ..^ ( gitFullShaLength + 1 ) ]
59+ : productVersion ;
60+ }
61+
62+ var activity = new DiscordActivity (
63+ $ "Use { commandPrefix } help for help (v{ versionString } )",
64+ DiscordActivityType . Custom ) ;
4765
4866 await _client . ConnectAsync ( activity ) ;
4967 }
You can’t perform that action at this time.
0 commit comments