File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Events } from 'discord.js' ;
22import ts from 'typescript' ;
3- import { SECOND } from '../constants/time.js' ;
3+ import { MINUTE } from '../constants/time.js' ;
44import { codeBlockRegex } from '../util/message.js' ;
55import { rateLimit } from '../util/rate-limit.js' ;
66import { createEvent } from './index.js' ;
77
8- const { canRun, reset } = rateLimit ( 5 * SECOND ) ;
8+ const { canRun, reset } = rateLimit ( 5 * MINUTE ) ;
99
1010const hasVarDeclaration = ( code : string , language : string ) : boolean => {
1111 if ( ! [ 'js' , 'javascript' , 'ts' , 'typescript' ] . includes ( language . toLowerCase ( ) ) ) {
@@ -18,13 +18,6 @@ const hasVarDeclaration = (code: string, language: string): boolean => {
1818 let foundVar = false ;
1919
2020 const checkNode = ( node : ts . Node ) => {
21- // if (node.kind === ts.SyntaxKind.VariableStatement) {
22- // const varStatement = node as ts.VariableStatement;
23-
24- // if (varStatement.declarationList.flags === ts.NodeFlags.None) {
25- // foundVar = true;
26- // }
27- // }
2821 if ( ts . isVariableStatement ( node ) ) {
2922 const declList = node . declarationList ;
3023 const isVar =
You can’t perform that action at this time.
0 commit comments