Skip to content

Commit

Permalink
fix: 更新 interactWithBot 函數以支援路由處理,修正 recordLatestGroupUser 函數定義
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshino committed Nov 11, 2024
1 parent d6b9f32 commit a2d53e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,15 @@ async function CustomerOrderBased(context, { next }) {
if (detectResult === false) return next;
}

function interactWithBot(context) {
function interactWithBot(context, { next }) {
return router([
askBot("你好", context => context.replyText("你好啊!")),
askBot(["誰的問題", "誰在搞"], whosProblem),
route("*", next),
]);
}

const recordLatestGroupUser = async (context, { next }) => {
async function recordLatestGroupUser(context, { next }) {
if (context.event.source.type !== "group") return next;
const { userId, groupId } = context.event.source;
if (!userId) return next;
Expand All @@ -393,7 +394,7 @@ const recordLatestGroupUser = async (context, { next }) => {
}

return next;
};
}

/**
* 誰的問題
Expand Down

0 comments on commit a2d53e4

Please sign in to comment.