-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
175 lines (174 loc) · 5.57 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/usr/bin/env node
import { prompt } from "inquirer";
import generateEvents from "./gen/Hedystia-Events";
import generateMessageProject from "./gen/Hedystia-Message";
import generateInteractionProject from "./gen/Hedystia-Slash";
prompt([
{
type: "list",
message: "What do you want to do?",
name: "command",
choices: ["Create new project", "Generate command (Coming soon)", "Generate event"],
},
{
type: "list",
when: ({ command }) => command === "Create new project",
message: "Inside a folder or outside?",
name: "selectDir",
choices: ["Inside", "Outside"],
},
{
type: "input",
when: ({ command }) => command === "Create new project",
message: "What would you like to call your project?",
name: "projectName",
validate: (name) => name.length > 0,
default: "project",
},
{
type: "password",
when: ({ command }) => command === "Create new project",
message: "Please enter your bot token:",
name: "projectToken",
validate: (name) => name.length > 0,
},
{
type: "list",
when: ({ command }) => command === "Create new project",
message: "Prefix or Slash?",
name: "prefixorslash",
choices: ["Prefix", "Slash"],
},
{
type: "input",
when: ({ prefixorslash }) => prefixorslash === "Prefix",
message: "What prefix would you like to add to the project?",
name: "prefix",
validate: (name) => name.length > 0,
default: "!",
},
{
type: "list",
when: ({ command }) => command === "Create new project",
message: "Do you want to install the dependencies?",
name: "install",
choices: ["Yes", "No"],
default: "Yes",
},
{
type: "list",
when: ({ install }) => install === "Yes",
message: "What package manager would you like to use?",
name: "packageManager",
choices: ["npm", "pnpm", "yarn", "bun"],
default: "npm",
},
{
type: "checkbox",
when: ({ command }) => command === "Generate event",
name: "events",
message: "What event(s) would you like to generate?",
choices: [
{ value: "applicationCommandPermissionsUpdate" },
{ value: "autoModerationActionExecution" },
{ value: "autoModerationRuleCreate" },
{ value: "autoModerationRuleDelete" },
{ value: "autoModerationRuleUpdate" },
{ value: "ready" },
{ value: "entitlementCreate" },
{ value: "entitlementDelete" },
{ value: "entitlementUpdate" },
{ value: "guildAuditLogEntryCreate" },
{ value: "guildAvailable" },
{ value: "guildCreate" },
{ value: "guildDelete" },
{ value: "guildUpdate" },
{ value: "guildUnavailable" },
{ value: "guildMemberAdd" },
{ value: "guildMemberRemove" },
{ value: "guildMemberUpdate" },
{ value: "guildMemberAvailable" },
{ value: "guildMembersChunk" },
{ value: "guildIntegrationsUpdate" },
{ value: "roleCreate" },
{ value: "roleDelete" },
{ value: "inviteCreate" },
{ value: "inviteDelete" },
{ value: "roleUpdate" },
{ value: "emojiCreate" },
{ value: "emojiDelete" },
{ value: "emojiUpdate" },
{ value: "guildBanAdd" },
{ value: "guildBanRemove" },
{ value: "channelCreate" },
{ value: "channelDelete" },
{ value: "channelUpdate" },
{ value: "channelPinsUpdate" },
{ value: "messageCreate" },
{ value: "messageDelete" },
{ value: "messageUpdate" },
{ value: "messageDeleteBulk" },
{ value: "messagePollVoteAdd" },
{ value: "messagePollVoteRemove" },
{ value: "messageReactionAdd" },
{ value: "messageReactionRemove" },
{ value: "messageReactionRemoveAll" },
{ value: "messageReactionRemoveEmoji" },
{ value: "threadCreate" },
{ value: "threadDelete" },
{ value: "threadUpdate" },
{ value: "threadListSync" },
{ value: "threadMemberUpdate" },
{ value: "threadMembersUpdate" },
{ value: "userUpdate" },
{ value: "presenceUpdate" },
{ value: "voiceServerUpdate" },
{ value: "voiceStateUpdate" },
{ value: "typingStart" },
{ value: "webhooksUpdate" },
{ value: "interactionCreate" },
{ value: "error" },
{ value: "warn" },
{ value: "debug" },
{ value: "cacheSweep" },
{ value: "shardDisconnect" },
{ value: "shardError" },
{ value: "shardReconnecting" },
{ value: "shardReady" },
{ value: "shardResume" },
{ value: "invalidated" },
{ value: "raw" },
{ value: "stageInstanceCreate" },
{ value: "stageInstanceUpdate" },
{ value: "stageInstanceDelete" },
{ value: "stickerCreate" },
{ value: "stickerDelete" },
{ value: "stickerUpdate" },
{ value: "guildScheduledEventCreate" },
{ value: "guildScheduledEventUpdate" },
{ value: "guildScheduledEventDelete" },
{ value: "guildScheduledEventUserAdd" },
{ value: "guildScheduledEventUserRemove" },
],
},
]).then((data) => {
if (data.command === "Create new project") {
const name = data.projectName.toLowerCase().replace(/\s+/g, "-");
const dir = data.selectDir;
const token = data.projectToken;
const install = data.install;
const packageManager = data.packageManager;
switch (data.prefixorslash) {
case "Prefix":
generateMessageProject(name, dir, data.prefix, token, install, packageManager);
break;
case "Slash":
generateInteractionProject(name, dir, token, install, packageManager);
break;
}
}
if (data.command === "Generate event") {
const events = data.events;
generateEvents(events);
}
});