everything is broken yay
This commit is contained in:
@@ -5,7 +5,6 @@ export const Capacity: SlashCommand = {
|
||||
name: 'modify-capacity',
|
||||
description: 'maximum amount messages bot will hold for context.',
|
||||
|
||||
// set available user options to pass to the command
|
||||
options: [
|
||||
{
|
||||
name: 'context-capacity',
|
||||
@@ -15,20 +14,23 @@ export const Capacity: SlashCommand = {
|
||||
}
|
||||
],
|
||||
|
||||
// Query for message information and set the style
|
||||
run: async (client: Client, interaction: CommandInteraction) => {
|
||||
// fetch channel and message
|
||||
const channel = await client.channels.fetch(interaction.channelId)
|
||||
if (!channel || !UserCommand.includes(channel.type)) return
|
||||
|
||||
// set state of bot chat features
|
||||
openConfig(`${interaction.user.username}-config.json`, interaction.commandName,
|
||||
interaction.options.get('context-capacity')?.value
|
||||
)
|
||||
const capacity = interaction.options.get('context-capacity')?.value
|
||||
if (typeof capacity !== 'number' || capacity <= 0) {
|
||||
await interaction.reply({
|
||||
content: 'Please provide a valid positive number for capacity.',
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
interaction.reply({
|
||||
content: `Max message history is now set to \`${interaction.options.get('context-capacity')?.value}\``,
|
||||
await openConfig(`${interaction.user.id}-config.json`, 'modify-capacity', capacity)
|
||||
await interaction.reply({
|
||||
content: `Max message history is now set to \`${capacity}\`.`,
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user