|
@@ -34,7 +34,7 @@ function linkFinder(checkedMatch, chat, lock) {
|
|
|
const link = Object.keys(lock.threads).find(realLink => normalizedLink === realLink.replace(/\/@/, '/').toLowerCase());
|
|
|
if (!link)
|
|
|
return [null, -1];
|
|
|
- const index = lock.threads[link].subscribers.findIndex(({ chatID, chatType }) => chat.chatID === chatID && chat.chatType === chatType);
|
|
|
+ const index = lock.threads[link].subscribers.findIndex(({ chatID, chatType }) => chat.chatID.toString() === chatID.toString() && chat.chatType === chatType);
|
|
|
return [link, index];
|
|
|
}
|
|
|
function sub(chat, args, reply, lock, lockfile) {
|
|
@@ -101,7 +101,7 @@ function unsubAll(chat, args, reply, lock, lockfile) {
|
|
|
return reply('请先添加机器人为好友。');
|
|
|
}
|
|
|
Object.entries(lock.threads).forEach(([link, { subscribers }]) => {
|
|
|
- const index = subscribers.findIndex(({ chatID, chatType }) => chat.chatID === chatID && chat.chatType === chatType);
|
|
|
+ const index = subscribers.findIndex(({ chatID, chatType }) => chat.chatID.toString() === chatID.toString() && chat.chatType === chatType);
|
|
|
if (index === -1)
|
|
|
return;
|
|
|
subscribers.splice(index, 1);
|