Added Interactive Setup CLI (Unfinished)

Added the first part of the interactive setup CLI. You can explore the interface but some parts will not work yet. It will also not save to the config file yet.

The "Quick Setup" & "Manage Plugins" parts of the CLI will arrive later this week.
This commit is contained in:
DJj123dj
2025-04-06 19:04:09 +02:00
parent 831e120093
commit 5f79ae909b
10 changed files with 649 additions and 79 deletions
+9 -1
View File
@@ -31,12 +31,13 @@ moduleInstalled("discord.js",true)
moduleInstalled("ansis",true)
moduleInstalled("formatted-json-stringify",true)
moduleInstalled("typescript",true)
moduleInstalled("terminal-kit",true)
tempError()
//init API
import * as api from "../api/api" //import for local use
export * as api from "../api/api" //export to other parts of bot
import ansis from "ansis" //import ansis for usage in initialization
export const opendiscord = new api.ODMain()
console.log("\n--------------------------- OPEN TICKET STARTUP ---------------------------")
@@ -103,6 +104,10 @@ export interface ODUtilities {
* Same as `string.replace(search, value)` but with async compatibility
*/
asyncReplace(text:string, regex:RegExp, func:(value:string,...args:any[]) => Promise<string>): Promise<string>
/**## getLongestLength `utility function`
* Get the length of the longest string in the array.
*/
getLongestLength(text:string[]): number
/**## easterEggs `utility object`
* Object containing data for Open Ticket easter eggs.
*/
@@ -208,6 +213,9 @@ export const utilities: ODUtilities = {
})
return result
},
getLongestLength(texts:string[]): number {
return Math.max(...texts.map((t) => ansis.strip(t).length))
},
easterEggs:{
/* THANK YOU TO ALL OUR CONTRIBUTORS!!! */
creator:"779742674932072469", //DJj123dj