This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
91 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 12 additions & 11 deletions
23
scripts/main/plugins/Custom Commands/global/home/listhome.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import { Command, CommandRegistration, Validation } from "../../../@modules"; | ||
import { Command, CommandRegistration } from "../../../@modules"; | ||
import { HomeDB } from "./sethome"; | ||
const registration = new CommandRegistration() | ||
.setName("listhome") | ||
.setDescription("Get all home") | ||
.setInputs({ 0: ["string"] }) | ||
.setUsage(["<homeName>"]) | ||
.setExample(["home myHome"]); | ||
.setExample(["listhome myHome"]); | ||
Command.BuildCommand(registration, (interaction) => { | ||
const { sender, inputs } = interaction; | ||
const homeName = inputs.getInput(0); | ||
if (Validation.isUndefined(homeName)) | ||
return sender.sendMessage("§cHome name cannot be empty"); | ||
const findHome = HomeDB.find((home) => home.creator === sender.name); | ||
return sender.sendMessage(`§b---- Home List ----\n\n${findHome.length === 0 | ||
const { sender } = interaction; | ||
const homes = []; | ||
for (const [, home] of HomeDB) { | ||
if (home.creator === sender.name) | ||
homes.push(home); | ||
} | ||
return sender.sendMessage(`§b---- Home List ----\n\n${homes.length === 0 | ||
? "§f# §7You don't have any home" | ||
: findHome | ||
: homes | ||
.sort() | ||
.map((home) => `§f# §7${home.name} - ${home.dimension}`)}`); | ||
.map((home) => `§f# §a${home.name} §7- ${home.dimension}`) | ||
.join("\n\n")}`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters