Fixed welcome
diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts
index eaf4fea..a4bb8c3 100644
--- a/src/events/interactionCreate.ts
+++ b/src/events/interactionCreate.ts
@@ -16,8 +16,16 @@
return fuse.slice(0, 25).map(option => ({name: option.item, value: option.item}))
}
-const validReplacements = ["serverName", "memberCount", "memberCount:bots", "memberCount:humans"]
function generateStatsChannelAutocomplete(typed) {
+ const validReplacements = ["serverName", "memberCount", "memberCount:bots", "memberCount:humans"]
+ let autocompletions = []
+ const beforeLastOpenBracket = typed.match(/(.*){[^{}]{0,15}$/)
+ if (beforeLastOpenBracket !== null) { for (let replacement of validReplacements) { autocompletions.push(`${beforeLastOpenBracket[1]} {${replacement}}`) } }
+ else { for (let replacement of validReplacements) { autocompletions.push(`${typed} {${replacement}}`) } }
+ return getAutocomplete(typed, autocompletions)
+}
+function generateWelcomeMessageAutocomplete(typed) {
+ const validReplacements = ["serverName", "memberCount", "memberCount:bots", "memberCount:humans", "member:mention", "member:name"]
let autocompletions = []
const beforeLastOpenBracket = typed.match(/(.*){[^{}]{0,15}$/)
if (beforeLastOpenBracket !== null) { for (let replacement of validReplacements) { autocompletions.push(`${beforeLastOpenBracket[1]} {${replacement}}`) } }
@@ -39,6 +47,7 @@
switch (`${interaction.commandName} ${interaction.options.getSubcommandGroup(false)} ${interaction.options.getSubcommand(false)}`) {
case `tag null null`: { return interaction.respond(getAutocomplete(interaction.options.getString("tag"), (await tagAutocomplete(interaction)))) }
case `settings null stats`: { return interaction.respond(generateStatsChannelAutocomplete(interaction.options.getString("name"))) }
+ case `settings null welcome`: { return interaction.respond(generateWelcomeMessageAutocomplete(interaction.options.getString("message"))) }
}
}
}