Skip to content

Commit bfedf98

Browse files
committed
fixes
1 parent dcb17d3 commit bfedf98

File tree

5 files changed

+32
-19
lines changed

5 files changed

+32
-19
lines changed

src/commands/is-a-dev/get-domain-json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const command: Command = {
8787
// Fetch all subdomains
8888
const data = await getDomains(client, {
8989
excludeFlags: ["internal", "reserved"],
90-
result_limit: 25,
90+
resultLimit: 25,
9191
subdomainStartsWith: option.value
9292
});
9393

src/commands/is-a-dev/redirect-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const command: Command = {
8585
// Fetch all subdomains
8686
const res = await getDomains(client, {
8787
excludeFlags: ["internal", "reserved"],
88-
result_limit: 25,
88+
resultLimit: 25,
8989
subdomainStartsWith: option.value
9090
});
9191

src/commands/is-a-dev/stats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const command: Command = {
103103
const option = interaction.options.getFocused(true);
104104

105105
if (option.name === "user") {
106-
const users = await getUsernames(client, { result_limit: 25 });
106+
const users = await getUsernames(client, { resultLimit: 25 });
107107

108108
const filteredUsers = users.filter((username) => username.startsWith(option.value.toLowerCase()));
109109

src/commands/is-a-dev/whois.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ const command: Command = {
206206
// Fetch all subdomains
207207
const res = await getDomains(client, {
208208
excludeFlags: ["internal", "reserved"],
209-
result_limit: 25,
209+
resultLimit: 25,
210210
subdomainStartsWith: option.value
211211
});
212212

src/util/functions.ts

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,38 @@ export async function getDirs(path: string): Promise<string[]> {
2626

2727
export async function getDomains(
2828
client: ExtendedClient,
29-
options?: {
29+
options: {
3030
excludeIAD?: boolean;
3131
excludeUnderscores?: boolean;
3232
excludeFlags?: ("internal" | "reserved")[];
3333
hasFlags?: ("internal" | "reserved")[];
3434
hasRecords?: ("A" | "AAAA" | "CAA" | "CNAME" | "DS" | "MX" | "NS" | "SRV" | "TLSA" | "TXT" | "URL")[];
35-
result_limit?: number;
35+
resultLimit?: number;
3636
subdomain?: string | null;
3737
subdomainStartsWith?: string;
3838
username?: string | null;
39+
} = {
40+
excludeIAD: false,
41+
excludeUnderscores: false,
42+
excludeFlags: [],
43+
hasFlags: [],
44+
hasRecords: [],
45+
resultLimit: 0,
46+
subdomain: null,
47+
subdomainStartsWith: "",
48+
username: null
3949
}
4050
): Promise<Domain[]> {
4151
const {
42-
excludeIAD = false,
43-
excludeUnderscores = false,
44-
excludeFlags = [],
45-
hasFlags = [],
46-
hasRecords = [],
47-
result_limit = 0,
48-
subdomain = null,
49-
subdomainStartsWith = "",
50-
username = null
52+
excludeIAD,
53+
excludeUnderscores,
54+
excludeFlags,
55+
hasFlags,
56+
hasRecords,
57+
resultLimit,
58+
subdomain,
59+
subdomainStartsWith,
60+
username
5161
} = options;
5262

5363
if (
@@ -82,11 +92,14 @@ export async function getDomains(
8292
return true;
8393
});
8494

85-
return result_limit <= 0 ? results : results.slice(0, result_limit);
95+
return resultLimit <= 0 ? results : results.slice(0, resultLimit);
8696
}
8797

88-
export async function getUsernames(client: ExtendedClient, options?: { result_limit: number }): Promise<string[]> {
89-
const { result_limit = 0 } = options;
98+
export async function getUsernames(
99+
client: ExtendedClient,
100+
options: { resultLimit: number } = { resultLimit: 0 }
101+
): Promise<string[]> {
102+
const { resultLimit } = options;
90103

91104
if (
92105
!client.rawAPICache ||
@@ -104,7 +117,7 @@ export async function getUsernames(client: ExtendedClient, options?: { result_li
104117
new Set(client.rawAPICache.map((entry: Domain) => entry.owner.username.toLowerCase()))
105118
).sort();
106119

107-
return result_limit <= 0 ? results : results.slice(0, result_limit);
120+
return resultLimit <= 0 ? results : results.slice(0, resultLimit);
108121
}
109122

110123
export function loadHandlers(client: ExtendedClient): void {

0 commit comments

Comments
 (0)