File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
tooling/sparta/packages/discord/src Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ import { logger } from "@sparta/utils/logger" ;
2+ import { NodeOperatorSubcommands } from "./types" ;
3+
4+ const commandsCount = {
5+ [ NodeOperatorSubcommands . MyStats ] : 0 ,
6+ [ NodeOperatorSubcommands . ChainInfo ] : 0 ,
7+ [ NodeOperatorSubcommands . Start ] : 0 ,
8+ [ NodeOperatorSubcommands . Help ] : 0 ,
9+ } ;
10+
11+ export function incrementCommandsCount ( command : NodeOperatorSubcommands ) {
12+ commandsCount [ command ] ++ ;
13+ logger . debug ( { command, count : commandsCount [ command ] } , "Commands count" ) ;
14+ }
Original file line number Diff line number Diff line change 88import { getValidatorStats } from "./my-info.js" ;
99import { registerValidator } from "./register.js" ;
1010import { showRegistrationHelp } from "./help.js" ;
11+ import { incrementCommandsCount } from "../../debug.js" ;
1112
1213export default {
1314 data : new SlashCommandBuilder ( )
@@ -63,15 +64,19 @@ export default {
6364 switch ( subcommand ) {
6465 case NodeOperatorSubcommands . MyStats :
6566 await getValidatorStats ( interaction ) ;
67+ incrementCommandsCount ( NodeOperatorSubcommands . MyStats ) ;
6668 break ;
6769 case NodeOperatorSubcommands . ChainInfo :
6870 await getChainInfo ( interaction ) ;
71+ incrementCommandsCount ( NodeOperatorSubcommands . ChainInfo ) ;
6972 break ;
7073 case NodeOperatorSubcommands . Start :
7174 await registerValidator ( interaction ) ;
75+ incrementCommandsCount ( NodeOperatorSubcommands . Start ) ;
7276 break ;
7377 case NodeOperatorSubcommands . Help :
7478 await showRegistrationHelp ( interaction ) ;
79+ incrementCommandsCount ( NodeOperatorSubcommands . Help ) ;
7580 break ;
7681 default :
7782 await interaction . editReply ( {
You can’t perform that action at this time.
0 commit comments