File tree Expand file tree Collapse file tree
DiscordLab.Administration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,12 +77,20 @@ public override void OnServerCommandExecuted(CommandExecutedEventArgs ev)
7777 if ( ev . Sender == null || ! Player . TryGet ( ev . Sender , out Player player ) )
7878 return ;
7979
80+ if ( string . IsNullOrEmpty ( ev . Command . Command ) )
81+ return ;
82+
83+ ArraySegment < string > args = ev . Arguments ;
84+
85+ if ( args == null )
86+ args = [ ] ;
87+
8088 SocketTextChannel channel ;
8189 TranslationBuilder builder = new TranslationBuilder ( "player" , player )
8290 . AddCustomReplacer ( "type" , ev . CommandType . ToString ( ) )
83- . AddCustomReplacer ( "arguments" , ( ) => string . Join ( " " , ev . Arguments ) )
91+ . AddCustomReplacer ( "arguments" , ( ) => string . Join ( " " , args ) )
8492 . AddCustomReplacer ( "command" , ev . Command . Command )
85- . AddCustomReplacer ( "commanddescription" , ev . Command . Description ) ;
93+ . AddCustomReplacer ( "commanddescription" , ev . Command . Description ?? "Unknown" ) ;
8694
8795 if ( ev . CommandType == CommandType . RemoteAdmin )
8896 {
You can’t perform that action at this time.
0 commit comments