Skip to content

Commit

Permalink
✨ feat: 채팅 전송 시 기본적으로 출력 대상에 포함되도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
gamgyul163 committed Nov 26, 2024
1 parent cad0b3d commit 1754d97
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Backend/apps/api/src/chats/chats.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ export class ChatsService {
nickname: string;
}) {
const chatId = crypto.randomUUID();
const chat = { content: message, userId, nickname, timestamp: new Date(), channelId, chatId };
const chat = {
content: message,
userId,
nickname,
timestamp: new Date(),
channelId,
chatId,
filteringResult: true,
};
const chatString = JSON.stringify(chat);
await this.redisClient.multi().publish(`${channelId}:chat`, chatString).lpush('chatQueue', chatId).exec();
this.clovaFiltering(chat);
Expand Down Expand Up @@ -64,7 +72,7 @@ export class ChatsService {
}),
);

chat.filteringResult = data?.result?.message?.content?.includes('false');
chat.filteringResult = data?.result?.message?.content?.includes('true');
await this.redisClient
.multi()
.publish(
Expand Down

0 comments on commit 1754d97

Please sign in to comment.