MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / handleSetup

Function handleSetup

src/commands/Community/app-admin.js:137–271  ·  view source on GitHub ↗
(interaction)

Source from the content-addressed store, hash-verified

135};
136
137async function handleSetup(interaction) {
138
139 if (interaction.deferred || interaction.replied) {
140 return await replyUserError(interaction, { type: ErrorTypes.UNKNOWN, message: 'This interaction has already been processed. Please try the command again.' });
141 }
142
143 const modal = new ModalBuilder()
144 .setCustomId('app_setup_modal')
145 .setTitle('Set Up New Application');
146
147 const roleSelect = new RoleSelectMenuBuilder()
148 .setCustomId('role_id')
149 .setPlaceholder('Select the role users will apply for')
150 .setRequired(true);
151
152 const roleLabel = new LabelBuilder()
153 .setLabel('Application Role')
154 .setDescription('The role that users will be applying for')
155 .setRoleSelectMenuComponent(roleSelect);
156
157 const appNameInput = new TextInputBuilder()
158 .setCustomId('app_name')
159 .setStyle(TextInputStyle.Short)
160 .setPlaceholder('e.g., Moderator, Helper, Developer')
161 .setMaxLength(50)
162 .setMinLength(1)
163 .setRequired(true);
164
165 const appNameLabel = new LabelBuilder()
166 .setLabel('Application Name')
167 .setTextInputComponent(appNameInput);
168
169 const q1Input = new TextInputBuilder()
170 .setCustomId('app_question_1')
171 .setStyle(TextInputStyle.Short)
172 .setPlaceholder('Why do you want this role?')
173 .setMaxLength(100)
174 .setMinLength(1)
175 .setRequired(true);
176
177 const q1Label = new LabelBuilder()
178 .setLabel('Question 1 (required)')
179 .setTextInputComponent(q1Input);
180
181 const q2Input = new TextInputBuilder()
182 .setCustomId('app_question_2')
183 .setStyle(TextInputStyle.Short)
184 .setPlaceholder('What experience do you have?')
185 .setMaxLength(100)
186 .setRequired(false);
187
188 const q2Label = new LabelBuilder()
189 .setLabel('Question 2 (optional)')
190 .setTextInputComponent(q2Input);
191
192 const q3Input = new TextInputBuilder()
193 .setCustomId('app_question_3')
194 .setStyle(TextInputStyle.Short)

Callers 1

app-admin.jsFile · 0.70

Calls 7

getApplicationRolesFunction · 0.90
saveApplicationRolesFunction · 0.90
getApplicationSettingsFunction · 0.90
successEmbedFunction · 0.90
replyUserErrorFunction · 0.85
updateSettingsMethod · 0.80

Tested by

no test coverage detected