@@ -75,7 +75,7 @@ function buildNotifiableData(newData, platform, notified) {
7575 const data = {
7676 acolytes : newData . persistentEnemies . filter ( e => ! notified . includes ( e . pid ) ) ,
7777 alerts : newData . alerts . filter ( a => ! a . expired && ! notified . includes ( a . id ) ) ,
78- baro : newData . voidTrader && ! notified . includes ( newData . voidTrader . id )
78+ baro : newData . voidTrader && ! notified . includes ( ` ${ newData . voidTrader . id } ${ newData . voidTrader . active ? '1' : '0' } ` )
7979 ? newData . voidTrader
8080 : undefined ,
8181 conclave : newData . conclaveChallenges
@@ -108,6 +108,8 @@ function buildNotifiableData(newData, platform, notified) {
108108 cetusCycleChange : between ( newData . cetusCycle . activation , platform ) ,
109109 earthCycleChange : between ( newData . earthCycle . activation , platform ) ,
110110 vallisCycleChange : between ( newData . vallisCycle . activation , platform ) ,
111+ cambionCycleChange : between ( newData . cambionCycle . activation , platform ) ,
112+ cambionCycle : newData . cambionCycle ,
111113 cetusCycle : newData . cetusCycle ,
112114 earthCycle : newData . earthCycle ,
113115 vallisCycle : newData . vallisCycle ,
@@ -178,9 +180,7 @@ class Notifier {
178180 refreshRate = timeout ;
179181 }
180182
181- /**
182- * Start the notifier
183- */
183+ /** Start the notifier */
184184 async start ( ) {
185185 Object . entries ( this . worldStates ) . forEach ( ( [ , ws ] ) => {
186186 ws . on ( 'newData' , async ( platform , newData ) => {
@@ -220,6 +220,7 @@ class Notifier {
220220 cetusCycle, earthCycle, vallisCycle, tweets, nightwave,
221221 cetusCycleChange, earthCycleChange, vallisCycleChange,
222222 featuredDeals, streams, popularDeals, primeAccess, updates, conclave,
223+ cambionCycle, cambionCycleChange,
223224 } ) {
224225 // Send all notifications
225226 const cycleIds = [ ] ;
@@ -256,6 +257,9 @@ class Notifier {
256257 cycleIds . push (
257258 await this . sendVallisCycle ( vallisCycle , platform , vallisCycleChange , notifiedIds ) ,
258259 ) ;
260+ cycleIds . push (
261+ await this . sendCambionCycle ( cambionCycle , platform , cambionCycleChange , notifiedIds ) ,
262+ ) ;
259263 this . sendUpdates ( updates , platform ) ;
260264 this . sendAlerts ( alerts , platform ) ;
261265 cycleIds . push (
@@ -272,7 +276,7 @@ class Notifier {
272276 alreadyNotified . push (
273277 ...rawData . persistentEnemies . map ( a => a . pid ) ,
274278 ...cycleIds ,
275- rawData . voidTrader . id ,
279+ ` ${ rawData . voidTrader . id } ${ rawData . voidTrader . active ? '1' : '0' } ` ,
276280 ...rawData . fissures . map ( f => f . id ) ,
277281 ...rawData . invasions . map ( i => i . id ) ,
278282 ...rawData . news . map ( n => n . id ) ,
@@ -281,7 +285,6 @@ class Notifier {
281285 rawData . sortie . id ,
282286 ...rawData . syndicateMissions . map ( m => m . id ) ,
283287 ...rawData . flashSales . map ( s => s . id ) ,
284- rawData . voidTrader . id ,
285288 ...rawData . dailyDeals . map ( d => d . id ) ,
286289 ...rawData . conclaveChallenges . map ( cc => cc . id ) ,
287290 ...rawData . weeklyChallenges . map ( w => w . id ) ,
@@ -349,10 +352,21 @@ class Notifier {
349352 }
350353 }
351354
352- async sendCetusCycle ( newCetusCycle , platform , cetusCycleChange , notifiedIds ) {
353- const minutesRemaining = cetusCycleChange ? '' : `.${ Math . round ( fromNow ( newCetusCycle . expiry ) / 60000 ) } ` ;
354- const type = `cetus.${ newCetusCycle . isDay ? 'day' : 'night' } ${ minutesRemaining } ` ;
355- const embed = new embeds . Cycle ( { logger } , newCetusCycle ) ;
355+ async sendCambionCycle ( newCycle , platform , cycleChange , notifiedIds ) {
356+ const minutesRemaining = cycleChange ? '' : `.${ Math . round ( fromNow ( newCycle . expiry ) / 60000 ) } ` ;
357+ const type = `cambion.${ newCycle . active } ${ minutesRemaining } ` ;
358+ if ( ! notifiedIds . includes ( type ) ) {
359+ await this . broadcaster . broadcast (
360+ new embeds . Cambion ( { logger } , newCycle ) , platform , type ,
361+ ) ;
362+ }
363+ return type ;
364+ }
365+
366+ async sendCetusCycle ( newCycle , platform , cycleChange , notifiedIds ) {
367+ const minutesRemaining = cycleChange ? '' : `.${ Math . round ( fromNow ( newCycle . expiry ) / 60000 ) } ` ;
368+ const type = `cetus.${ newCycle . isDay ? 'day' : 'night' } ${ minutesRemaining } ` ;
369+ const embed = new embeds . Cycle ( { logger } , newCycle ) ;
356370 if ( ! notifiedIds . includes ( type ) ) {
357371 await this . broadcaster . broadcast ( embed , platform , type ) ;
358372 }
@@ -379,12 +393,12 @@ class Notifier {
379393 await Promise . all ( newDarvoDeals . map ( d => this . broadcaster . broadcast ( new embeds . Darvo ( { logger } , d , platform ) , platform , 'darvo' ) ) ) ;
380394 }
381395
382- async sendEarthCycle ( newEarthCycle , platform , earthCycleChange , notifiedIds ) {
383- const minutesRemaining = earthCycleChange ? '' : `.${ Math . round ( fromNow ( newEarthCycle . expiry ) / 60000 ) } ` ;
384- const type = `earth.${ newEarthCycle . isDay ? 'day' : 'night' } ${ minutesRemaining } ` ;
396+ async sendEarthCycle ( newCycle , platform , cycleChange , notifiedIds ) {
397+ const minutesRemaining = cycleChange ? '' : `.${ Math . round ( fromNow ( newCycle . expiry ) / 60000 ) } ` ;
398+ const type = `earth.${ newCycle . isDay ? 'day' : 'night' } ${ minutesRemaining } ` ;
385399 if ( ! notifiedIds . includes ( type ) ) {
386400 await this . broadcaster . broadcast (
387- new embeds . Cycle ( { logger } , newEarthCycle ) , platform , type ,
401+ new embeds . Cycle ( { logger } , newCycle ) , platform , type ,
388402 ) ;
389403 }
390404 return type ;
0 commit comments