19 lines
955 B
TypeScript
19 lines
955 B
TypeScript
import type {Json} from '../../../../types/bot/workflow/workflow.ts';
|
|
import type {WorkflowEventTemplate} from '../../../../types/bot/workflow/metadata.ts';
|
|
import {describe, output, event_args_output} from '../../metadata.ts';
|
|
import {normalize_custom_event} from './custom.ts';
|
|
|
|
export const config_template: WorkflowEventTemplate = {
|
|
name: 'health', version: '1.0.0', readiness: 'spawned',
|
|
i18n: describe('生命状态事件', '生命状态更新时发出通知。生命值和饥饿值需通过 info 查询单独读取。'),
|
|
config: [],
|
|
output: {
|
|
...output('object', '生命状态通知', '包含事件名称和原始参数,不包含生命值或饥饿值快照。'),
|
|
properties: {event: output('string', '事件名称', '固定为 health。'), args: event_args_output},
|
|
},
|
|
};
|
|
|
|
export function normalize(args: unknown[] = []): Record<string, Json> | undefined {
|
|
return normalize_custom_event('health', args);
|
|
}
|