Skip to content

Commit ccf94d0

Browse files
committed
If no bot, ignore msg
1 parent 5590a6e commit ccf94d0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ringcentral-chatbot-core",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"license": "MIT",
55
"scripts": {
66
"test": "RINGCENTRAL_CHATBOT_DATABASE_CONNECTION_URI=sqlite:// jest -c test/jest.config.ts",

src/handlers/postAdded.ts

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export const postAdded = async (Bot: any, message: Message) => {
1414
}
1515
const groupId = message.body.groupId;
1616
const bot = (await Bot.findByPk(botId)) as unknown as BotType;
17+
if (!bot) {
18+
return;
19+
}
1720
const group = await bot.getGroup(groupId);
1821
const isPrivateChat = group.members.length <= 2;
1922
if (

0 commit comments

Comments
 (0)