decord/source/modules/guild_role_subscriptions/subscriptionUtils.tsx

35 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 14658
// Function ID: 14659
2026-07-20 16:05:17 +00:00
// Name: getRoleSubscriptionPlanId
2026-07-29 08:29:29 +00:00
// Dependencies: [38, 2]
2026-07-20 16:05:17 +00:00
// Exports: getRoleSubscriptionMutationPlanId, getRoleSubscriptionPlanId
2026-08-25 06:04:03 +00:00
// Module 14658 (getRoleSubscriptionPlanId)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import _modDef38 from "module_38" /* 38 */;
const result = set.fileFinishedImporting("modules/guild_role_subscriptions/subscriptionUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getRoleSubscriptionPlanId = function getRoleSubscriptionPlanId(items) {
items = items.items;
2026-08-24 06:08:38 +00:00
_modDef38(1 === items.length, "more than 1 subscription item for role subscription");
2026-07-20 16:05:17 +00:00
return items[0].planId;
};
export const getRoleSubscriptionMutationPlanId = function getRoleSubscriptionMutationPlanId(renewalMutations) {
let items;
2026-07-29 08:29:29 +00:00
if (renewalMutations != null) {
2026-07-20 16:05:17 +00:00
renewalMutations = renewalMutations.renewalMutations;
2026-07-29 08:29:29 +00:00
if (renewalMutations != null) {
2026-07-20 16:05:17 +00:00
items = renewalMutations.items;
}
}
if (null != items) {
2026-08-24 06:08:38 +00:00
_modDef38(items.length <= 1, "more than 1 renewal mutation for role subscription");
2026-07-20 16:05:17 +00:00
let planId;
2026-07-29 08:29:29 +00:00
if (items != null) {
2026-07-20 16:05:17 +00:00
planId = items[0].planId;
}
return planId;
}
};