Skip to content

Commit

Permalink
fix wrong max length
Browse files Browse the repository at this point in the history
  • Loading branch information
Techbot121 authored and Meta Construct committed Jun 11, 2024
1 parent 9eaa5c6 commit ef13a1e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/services/discord/modules/commands/developer/Ban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const SlashBanCommand: SlashCommand = {
name: "server",
description: "The server to run the command on",
choices: servers
.filter(s => s.ssh)
.filter(s => !!s.ssh)
.map(s => {
return { name: s.name, value: s.id };
}),
Expand Down
11 changes: 7 additions & 4 deletions app/services/discord/modules/commands/developer/Gserv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ export const SlashGservCommand: SlashCommand = {
custom_id: "gserv_server",
placeholder: "Choose a server.",
min_values: 1,
max_values: servers.length,
max_values: servers.filter(s => !!s.ssh).length,
options: servers
.filter(s => s.ssh)
.filter(s => !!s.ssh)
.map(
server =>
<Discord.APISelectMenuOption>{
Expand Down Expand Up @@ -212,12 +212,15 @@ export const SlashGservCommand: SlashCommand = {
})
.catch(err => result.update(`something went wrong!\`\`\`\n${err}\`\`\``));
} catch (err) {
console.error(err);
await ctx.editReply(JSON.stringify(err));
}
} catch {
} catch (err) {
console.error(err);
await ctx.deleteReply();
}
} catch {
} catch (err) {
console.error(err);
await ctx.deleteReply();
}
},
Expand Down
2 changes: 1 addition & 1 deletion app/services/discord/modules/commands/developer/Kick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const SlashKickCommand: SlashCommand = {
name: "server",
description: "The server to run the command on",
choices: servers
.filter(s => s.ssh)
.filter(s => !!s.ssh)
.map(s => {
return { name: s.name, value: s.id };
}),
Expand Down
2 changes: 1 addition & 1 deletion app/services/discord/modules/commands/developer/Lua.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const SlashLuaCommand: SlashCommand = {
name: "server",
description: "The server to run the code on",
choices: servers
.filter(s => s.ssh)
.filter(s => !!s.ssh)
.map(s => {
return { name: s.name, value: s.id };
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const SlashRefreshLuaCommand: SlashCommand = {
name: "server",
description: "The server to run the command on",
choices: servers
.filter(s => s.ssh)
.filter(s => !!s.ssh)
.map(s => {
return { name: s.name, value: s.id };
}),
Expand Down
2 changes: 1 addition & 1 deletion app/services/discord/modules/commands/developer/UnBan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const SlashUnBanCommand: SlashCommand = {
name: "server",
description: "The server to run the command on",
choices: servers
.filter(s => s.ssh)
.filter(s => !!s.ssh)
.map(s => {
return { name: s.name, value: s.id };
}),
Expand Down

0 comments on commit ef13a1e

Please sign in to comment.