Skip to content

Commit

Permalink
events: fix facequiz follow-up
Browse files Browse the repository at this point in the history
  • Loading branch information
tomfa committed Sep 30, 2023
1 parent 25b9cc5 commit 1116f46
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/events.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ChatBot } from "./types";
import { fetchUsers } from "./data";

const { MessageError } = require("./errors");
const { getUser } = require("./data");
Expand All @@ -20,7 +21,11 @@ const addNameGuessEventHandler = (app: ChatBot) => {
await say(`Nope! :cry: ${text}`);
}
try {
const quiz = await getFaceQuiz({ exclude: [user.id, body.user.id] });
const slackUsers = await fetchUsers({ app });
const quiz = await getFaceQuiz({
slackUsers,
exclude: [user.id, body.user.id],
});
await say(quiz);
} catch (error) {
if (error instanceof MessageError) {
Expand Down

0 comments on commit 1116f46

Please sign in to comment.