MCPcopy Create free account
hub / github.com/Monogatari/Monogatari / shouldProceed

Method shouldProceed

src/actions/Play.ts:11–27  ·  view source on GitHub ↗
(context?: any)

Source from the content-addressed store, hash-verified

9 static override id = 'Play';
10
11 static override async shouldProceed(context?: any): Promise<void> {
12 if (typeof context !== 'object' || context === null) {
13 return;
14 }
15
16 const { userInitiated, skip } = context;
17
18 if (userInitiated === false && skip === false) {
19 const voicePlayers = this.engine.mediaPlayers('voice') as (HTMLAudioElement | HTMLVideoElement | AudioPlayer)[];
20
21 for (const player of voicePlayers) {
22 if (!player.ended) {
23 throw new Error('Voice player still playing.');
24 }
25 }
26 }
27 }
28
29 static override async willProceed(): Promise<void> {
30 Play.shutUp();

Callers

nothing calls this directly

Calls 1

mediaPlayersMethod · 0.80

Tested by

no test coverage detected