From 61d3dc43128f9134dcbd8cce75a5c5cf25d29a0b Mon Sep 17 00:00:00 2001 From: Kevin Dang <77701718+kevinthedang@users.noreply.github.com> Date: Wed, 10 Jul 2024 20:41:23 -0700 Subject: [PATCH] User Preferences Fix (#83) * Fix: incorrect user preferences saving --- src/commands/capacity.ts | 2 +- src/commands/messageStream.ts | 2 +- src/commands/messageStyle.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/capacity.ts b/src/commands/capacity.ts index 6a47dc3..d6bb5d3 100644 --- a/src/commands/capacity.ts +++ b/src/commands/capacity.ts @@ -23,7 +23,7 @@ export const Capacity: SlashCommand = { if (!channel || channel.type !== (ChannelType.PublicThread && ChannelType.GuildText)) return // set state of bot chat features - openConfig(`${interaction.client.user.username}-config.json`, interaction.commandName, interaction.options.get('context-capacity')?.value) + openConfig(`${interaction.user.username}-config.json`, interaction.commandName, interaction.options.get('context-capacity')?.value) interaction.reply({ content: `Message History Capacity has been set to \`${interaction.options.get('context-capacity')?.value}\``, diff --git a/src/commands/messageStream.ts b/src/commands/messageStream.ts index ab56b3f..254dd2e 100644 --- a/src/commands/messageStream.ts +++ b/src/commands/messageStream.ts @@ -23,7 +23,7 @@ export const MessageStream: SlashCommand = { if (!channel || channel.type !== (ChannelType.PublicThread && ChannelType.GuildText)) return // save value to json and write to it - openConfig(`${interaction.client.user.username}-config.json`, interaction.commandName, interaction.options.get('stream')?.value) + openConfig(`${interaction.user.username}-config.json`, interaction.commandName, interaction.options.get('stream')?.value) interaction.reply({ content: `Message streaming preferences set to: \`${interaction.options.get('stream')?.value}\``, diff --git a/src/commands/messageStyle.ts b/src/commands/messageStyle.ts index ae7a1c7..7833fb6 100644 --- a/src/commands/messageStyle.ts +++ b/src/commands/messageStyle.ts @@ -23,7 +23,7 @@ export const MessageStyle: SlashCommand = { if (!channel || channel.type !== (ChannelType.PublicThread && ChannelType.GuildText)) return // set the message style - openConfig(`${interaction.client.user.username}-config.json`, interaction.commandName, interaction.options.get('embed')?.value) + openConfig(`${interaction.user.username}-config.json`, interaction.commandName, interaction.options.get('embed')?.value) interaction.reply({ content: `Message style preferences for embed set to: \`${interaction.options.get('embed')?.value}\``,