roles-bot/packages/bot/src/utils/resolveButtonStyle.ts

17 lines
373 B
TypeScript
Raw Normal View History

2023-04-09 15:36:53 +02:00
import { ButtonStyle } from "discord-api-types/v10";
export default function (style: string) {
switch (style.toLowerCase()) {
case "primary":
return ButtonStyle.Primary;
case "secondary":
return ButtonStyle.Secondary;
case "success":
return ButtonStyle.Success;
case "danger":
return ButtonStyle.Danger;
default:
return ButtonStyle.Primary;
}
}