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

Method willApply

src/actions/Message.ts:61–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59 }
60
61 override async willApply(): Promise<void> {
62 if (typeof this.message !== 'undefined') {
63 // Check if the old format is being use and translate it to the new one
64 if (this.message.Title && this.message.Subtitle && this.message.Message) {
65 this.message.title = this.message.Title;
66 this.message.subtitle = this.message.Subtitle;
67 this.message.body = this.message.Message;
68 }
69 return Promise.resolve();
70 } else {
71 FancyError.show('action:message:not_found', {
72 id: this.id,
73 availableMessages: Object.keys(Message.messages()),
74 label: this.engine.state('label'),
75 step: this.engine.state('step')
76 });
77 }
78
79 return Promise.reject();
80 }
81
82 override async apply(): Promise<void> {
83 Message.blocking = true;

Callers

nothing calls this directly

Calls 4

messagesMethod · 0.80
stateMethod · 0.80
keysMethod · 0.65
showMethod · 0.45

Tested by

no test coverage detected