mirror of
https://github.com/hexastack/hexabot
synced 2024-12-02 00:54:56 +00:00
fix: add console-channel before filtering
This commit is contained in:
parent
4ab0e1be3c
commit
f2b8e63e94
@ -12,6 +12,7 @@ import { Attachment } from '@/attachment/schemas/attachment.schema';
|
||||
import { AttachmentService } from '@/attachment/services/attachment.service';
|
||||
import EventWrapper from '@/channel/lib/EventWrapper';
|
||||
import { ContentService } from '@/cms/services/content.service';
|
||||
import { CONSOLE_CHANNEL_NAME } from '@/extensions/channels/console/settings';
|
||||
import { Nlp } from '@/helper/types';
|
||||
import { I18nService } from '@/i18n/services/i18n.service';
|
||||
import { LanguageService } from '@/i18n/services/language.service';
|
||||
@ -76,7 +77,7 @@ export class BlockService extends BaseService<Block, BlockPopulate, BlockFull> {
|
||||
return (
|
||||
!b.trigger_channels ||
|
||||
b.trigger_channels.length === 0 ||
|
||||
b.trigger_channels.includes(channel)
|
||||
[...b.trigger_channels, CONSOLE_CHANNEL_NAME].includes(channel)
|
||||
);
|
||||
});
|
||||
|
||||
@ -607,4 +608,8 @@ export class BlockService extends BaseService<Block, BlockPopulate, BlockFull> {
|
||||
throw new Error('Invalid message format.');
|
||||
}
|
||||
}
|
||||
|
||||
getCategoryBlocks(categoryId: string) {
|
||||
return this.repository.model.find({ category: categoryId });
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user