Skip to content

Commit

Permalink
fix(rx): fix from to forkJoin
Browse files Browse the repository at this point in the history
  • Loading branch information
sd0xdev committed Sep 24, 2023
1 parent 90fe7dc commit 14e70f3
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Subject,
catchError,
finalize,
forkJoin,
from,
lastValueFrom,
of,
Expand Down Expand Up @@ -85,13 +86,11 @@ export class DiscordBotService implements OnApplicationBootstrap {

private messageCreateListenerObservers(message: Message<boolean>) {
const stopSignal$ = new Subject();
return from([
this.checkIsBotMessage(message),
this.checkShouldReply(message),
this.checkIsDisableBotChannel(message),
return forkJoin([
of(this.checkIsBotMessage(message)),
of(this.checkShouldReply(message)),
of(this.checkIsDisableBotChannel(message)),
]).pipe(
take(3),
toArray(),
switchMap((mods) => {
if (mods.some((mod) => mod === true)) {
stopSignal$.next('STOP');
Expand Down

0 comments on commit 14e70f3

Please sign in to comment.