Skip to content

Commit 7cce59f

Browse files
committed
refactor: Adjust timeout duration for var detection to 5 minutes
1 parent e5a0c8a commit 7cce59f

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/events/has-var.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Events } from 'discord.js';
22
import ts from 'typescript';
3-
import { SECOND } from '../constants/time.js';
3+
import { MINUTE } from '../constants/time.js';
44
import { codeBlockRegex } from '../util/message.js';
55
import { rateLimit } from '../util/rate-limit.js';
66
import { createEvent } from './index.js';
77

8-
const { canRun, reset } = rateLimit(5 * SECOND);
8+
const { canRun, reset } = rateLimit(5 * MINUTE);
99

1010
const 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 =

0 commit comments

Comments
 (0)