ds4/src/macros/roll-generic-check.ts
2022-11-04 21:47:18 +01:00

19 lines
642 B
TypeScript

// SPDX-FileCopyrightText: 2021 Johannes Loher
//
// SPDX-License-Identifier: MIT
import { notifications } from "../ui/notifications";
import { getGame } from "../utils/utils";
import { getActiveActorAndToken } from "./helpers";
/**
* Executes the roll generic check macro.
*/
export async function rollGenericCheck(): Promise<void> {
const { actor, token } = getActiveActorAndToken();
if (!actor) {
return notifications.warn(getGame().i18n.localize("DS4.WarningMustControlActorToUseRollCheckMacro"));
}
return actor.rollGenericCheck({ speaker: { token } }).catch((e) => notifications.error(e, { log: true }));
}