File tree 1 file changed +6
-3
lines changed
src/main/typescript/commands/settings
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -135,20 +135,23 @@ class RestartCommand extends Command {
135
135
}
136
136
137
137
public override async execute ( context : Context ) : Promise < void > {
138
+ const mfaKey = context . isChatInput ( ) ? context . options . getString ( "credential_key" ) : "" ;
139
+
140
+ this . application . logger . debug ( "Conditions: " , ! ! getEnvData ( ) . TWO_FACTOR_AUTH_URL , ! mfaKey ) ;
141
+
138
142
if (
139
143
getEnvData ( ) . TWO_FACTOR_AUTH_URL &&
140
- ( ! context . isChatInput ( ) || context . options . getString ( "credential_key" ) )
144
+ ! mfaKey
141
145
) {
142
146
await context . error (
143
147
"Please enter the credential server 2FA code to restart the bot" +
144
148
( context . isLegacy ( ) ? " using the slash command" : "" ) +
145
149
"!"
146
150
) ;
151
+
147
152
return ;
148
153
}
149
154
150
- const mfaKey = context . isChatInput ( ) ? context . options . getString ( "credential_key" ) : "" ;
151
-
152
155
const reply = await context . reply ( {
153
156
embeds : [
154
157
{
You can’t perform that action at this time.
0 commit comments