Skip to content

Commit

Permalink
fix: fix hub settings giving errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Dec 31, 2023
1 parent f0ae9dd commit ef37881
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/commands/slash/Main/hub/manage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ export default class Manage extends Hub {
// settings button
if (interaction.isButton()) {
if (customId.suffix === 'settingsBtn') {
const { name, iconUrl, settings } = hubInDb;
const { id, name, iconUrl, settings } = hubInDb;
const embed = buildSettingsEmbed(name, iconUrl, settings);
const selects = buildSettingsMenu(settings, name, customId.args[0]);
const selects = buildSettingsMenu(settings, id, customId.args[0]);

await interaction.reply({ embeds: [embed], components: [selects], ephemeral: true });
}
Expand Down Expand Up @@ -372,10 +372,10 @@ export default class Manage extends Hub {
return;
}

const { name, iconUrl, settings } = updHub;
const { id, name, iconUrl, settings } = updHub;

const embed = buildSettingsEmbed(name, iconUrl, settings);
const selects = buildSettingsMenu(settings, name, customId.args[0]);
const selects = buildSettingsMenu(settings, id, customId.args[0]);

await interaction.update({
embeds: [embed],
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/hub/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function buildSettingsEmbed(name: string, iconURL: string, rawSettings: n

export function buildSettingsMenu(
rawSettings: number,
hubName: string,
hubId: string,
userId: Snowflake,
) {
const hubSettings = new HubSettingsBitField(rawSettings);
Expand All @@ -41,7 +41,7 @@ export function buildSettingsMenu(
new CustomID()
.setIdentifier('hub_manage', 'settingsSelect')
.addArgs(userId)
.addArgs(hubName)
.addArgs(hubId)
.toString(),
)
.setPlaceholder('Select an option')
Expand Down

0 comments on commit ef37881

Please sign in to comment.