Skip to content

Commit

Permalink
make lookup cmd have ephemeral option + more
Browse files Browse the repository at this point in the history
  • Loading branch information
MidSpike committed Oct 24, 2023
1 parent fec8a43 commit 2e32543
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
16 changes: 14 additions & 2 deletions src/custom_interactions/chat_input/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ export default new CustomInteraction({
type: Discord.ApplicationCommandOptionType.User,
description: 'The discord user to lookup.',
required: true,
}, {
name: 'ephemeral',
type: Discord.ApplicationCommandOptionType.Boolean,
description: 'Whether or not to respond with an ephemeral message.',
required: false,
},
],
}, {
Expand All @@ -54,6 +59,11 @@ export default new CustomInteraction({
type: Discord.ApplicationCommandOptionType.String,
description: 'The roblox user id to lookup.',
required: true,
}, {
name: 'ephemeral',
type: Discord.ApplicationCommandOptionType.Boolean,
description: 'Whether or not to respond with an ephemeral message.',
required: false,
},
],
},
Expand All @@ -68,10 +78,12 @@ export default new CustomInteraction({
if (!interaction.inCachedGuild()) return;
if (!interaction.channel) return;

await interaction.deferReply({ ephemeral: false });

const subcommand_name = interaction.options.getSubcommand(true);

const respond_as_ephemeral: boolean = interaction.options.getBoolean('ephemeral', false) ?? false; // default to false

await interaction.deferReply({ ephemeral: respond_as_ephemeral });

let user_id_type: 'discord' | 'roblox';
let user_id: string;
switch (subcommand_name) {
Expand Down
2 changes: 1 addition & 1 deletion src/custom_interactions/chat_input/manage_user_identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default new CustomInteraction({
if (!interaction.isChatInputCommand()) return;
if (!interaction.inCachedGuild()) return;

await interaction.deferReply();
await interaction.deferReply({ ephemeral: false });

// ensure the user running this command is authorized to do so
const staff_member = interaction.member;
Expand Down
2 changes: 1 addition & 1 deletion src/custom_interactions/chat_input/manage_user_lumens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default new CustomInteraction({
if (!interaction.isChatInputCommand()) return;
if (!interaction.inCachedGuild()) return;

await interaction.deferReply();
await interaction.deferReply({ ephemeral: false });

const user_to_modify = interaction.options.getUser('for', true);
const action_to_perform = interaction.options.getString('action', true) as ManageLumensAction;
Expand Down
4 changes: 2 additions & 2 deletions src/custom_interactions/chat_input/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default new CustomInteraction({
}, {
name: 'ephemeral',
type: Discord.ApplicationCommandOptionType.Boolean,
description: 'Whether or not to send the profile as an ephemeral message.',
description: 'Whether or not to respond with an ephemeral message.',
required: false,
},
],
Expand All @@ -39,7 +39,7 @@ export default new CustomInteraction({
if (!interaction.inCachedGuild()) return;
if (!interaction.channel) return;

const respond_as_ephemeral = interaction.options.getBoolean('ephemeral', false) ?? false; // default to false
const respond_as_ephemeral: boolean = interaction.options.getBoolean('ephemeral', false) ?? false; // default to false

await interaction.deferReply({ ephemeral: respond_as_ephemeral });

Expand Down

0 comments on commit 2e32543

Please sign in to comment.