Skip to content

Commit

Permalink
chore: make docs private by default (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored May 28, 2023
1 parent 9e8bc03 commit 4e6d31b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/DocsLookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ const make = Effect.gen(function* (_) {
},
{
type: Discord.ApplicationCommandOptionType.BOOLEAN,
name: "silent",
description: "Only show the results to you",
name: "public",
description: "Make the results visible for everyone",
required: false,
},
],
Expand All @@ -100,18 +100,18 @@ const make = Effect.gen(function* (_) {
pipe(
Effect.all({
key: ix.optionValue("query"),
silent: Effect.map(
ix.optionValueOptional("silent"),
reveal: Effect.map(
ix.optionValueOptional("public"),
Option.getOrElse(() => false),
),
docs: allDocs,
}),
Effect.bind("embed", ({ key, docs }) => docs.map[key].embed),
Effect.map(({ embed, silent }) =>
Effect.map(({ embed, reveal }) =>
Ix.response({
type: Discord.InteractionCallbackType.CHANNEL_MESSAGE_WITH_SOURCE,
data: {
flags: silent ? Discord.MessageFlag.EPHEMERAL : undefined,
flags: reveal ? undefined : Discord.MessageFlag.EPHEMERAL,
embeds: [embed],
},
}),
Expand Down

0 comments on commit 4e6d31b

Please sign in to comment.