Skip to content

Commit

Permalink
Permission updates
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Feb 20, 2024
1 parent 5f7dc13 commit 2518776
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/discord/commands/global/d.ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1184,11 +1184,13 @@ async function personasPage(
);
}

components.push(
new ActionRowBuilder<StringSelectMenuBuilder>().addComponents([
menuAiPublic,
]),
);
if (tripsitMember.roles.cache.has(env.ROLE_DEVELOPER)) {
components.push(
new ActionRowBuilder<StringSelectMenuBuilder>().addComponents([
menuAiPublic,
]),
);
}

return {
embeds: [await makePersonaEmbed(persona)],
Expand Down Expand Up @@ -1437,12 +1439,14 @@ async function setupPage(
]),
];

if (aiLinkData && linkedPersona === selectedPersona) {
components.push(new ActionRowBuilder<ButtonBuilder>()
.addComponents(buttonAiUnlink));
} else if (selectedChannel && selectedPersona && selectedPersona !== 'none') {
components.push(new ActionRowBuilder<ButtonBuilder>()
.addComponents(buttonAiLink));
if ((interaction.member as GuildMember).permissions.has(PermissionFlagsBits.ManageChannels)) {
if (aiLinkData && linkedPersona === selectedPersona) {
components.push(new ActionRowBuilder<ButtonBuilder>()
.addComponents(buttonAiUnlink));
} else if (selectedChannel && selectedPersona && selectedPersona !== 'none') {
components.push(new ActionRowBuilder<ButtonBuilder>()
.addComponents(buttonAiLink));
}
}

return {
Expand Down

0 comments on commit 2518776

Please sign in to comment.