This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overwrites properly working in all modes, added setkey, not having an…
… api does not break the application, added proper default settings to the application, hypixel.js now supports setkey, help now works for specific commands, added all parameter to onHover and onClick for Message class, nicks now give warnings
- Loading branch information
1 parent
7879812
commit 320fae8
Showing
11 changed files
with
224 additions
and
99 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
node_modules/ | ||
inStream.txt | ||
HyProxyConfig.json | ||
dist/ | ||
oldSRC/ | ||
dist/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const Command = require('../utils/classes/command') | ||
const { Message } = require("../utils/classes/message") | ||
const { writeFileSync } = require("fs") | ||
const { join } = require("path") | ||
const config = require(join(process.cwd(), "HyProxyConfig.json")) | ||
const { keyInfo, setKey } = require("../utils/api/hypixel") | ||
const design = config.config | ||
|
||
module.exports = class extends Command { | ||
constructor() { | ||
super({ | ||
name: "setkey", | ||
description: "Set the API key for HyProxy", | ||
example: "setkey abcdefgh-ijkl-mnop-qrst-uvwxyz123456", | ||
aliases: [ | ||
"rq" | ||
] | ||
}) | ||
} | ||
|
||
async run(client, message, args, server, user) { | ||
if (!args[0]) { | ||
const msg = new Message("Please provide an API key, generate one using /api new", { color: design.colours.failed }).stringify(); | ||
client.write("chat", { message: msg }) | ||
} else { | ||
try { | ||
const info = await keyInfo(args[0]); | ||
config.apiKey = info.key; | ||
setKey(info.key) | ||
writeFileSync(join(process.cwd(), "HyProxyConfig.json"), JSON.stringify(config, null, 4)) | ||
const msg = new Message("Successfully set API key!", { color: design.colours.success }).stringify(); | ||
client.write("chat", { message: msg }) | ||
} catch (e) { | ||
console.log(e) | ||
const msg = new Message("Invalid API key! Generate a new one using /api new", { color: design.colours.failed }).stringify(); | ||
client.write("chat", { message: msg }) | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"0": "gray", | ||
"1": "white", | ||
"2": "gold", | ||
"3": "aqua", | ||
"4": "dark_green", | ||
"5": "dark_aqua", | ||
"6": "dark_red", | ||
"7": "light_purple", | ||
"8": "blue", | ||
"9": "dark_purple", | ||
"10": "yellow", | ||
"11": "white", | ||
"12": "gold", | ||
"13": "aqua", | ||
"14": "dark_green", | ||
"15": "dark_aqua", | ||
"16": "dark_red", | ||
"17": "light_purple", | ||
"18": "blue", | ||
"19": "dark_purple", | ||
"20": "dark_gray", | ||
"21": "yellow", | ||
"22": "yellow", | ||
"23": "yellow", | ||
"24": "yellow", | ||
"25": "yellow", | ||
"26": "yellow", | ||
"27": "yellow", | ||
"28": "yellow", | ||
"29": "yellow", | ||
"30": "yellow" | ||
} |
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
Oops, something went wrong.