Skip to content

Commit

Permalink
Go back to ephmeral messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinan-96 committed Oct 3, 2024
1 parent 1c681cc commit 546d661
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ app.command("/addcategory", async ({ command, ack, respond }) => {

app.event("message", async ({ event, client }) => {
// Check if the message is a new message
if (event.subtype) {
if (event.subtype || (event.thread_ts && event.thread_ts !== event.ts)) {
// Ignore everything except new messages
return;
}
Expand All @@ -65,8 +65,9 @@ app.event("message", async ({ event, client }) => {

try {
// Respond with an ephemeral message containing a dropdown menu
await client.chat.postMessage({
await client.chat.postEphemeral({
channel: event.channel, // The channel where the message was posted
user: event.user, // The user who triggered the event
text: `Hello, <@${event.user}>! Please choose a category:`,
blocks: [
{
Expand Down

0 comments on commit 546d661

Please sign in to comment.