decord/source/modules/guild_role_subscriptions/subscriptionUtils.tsx

32 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-07-28 08:39:19 +00:00
// Module ID: 14209
// Function ID: 109137
2026-07-20 16:05:17 +00:00
// Name: getRoleSubscriptionPlanId
2026-07-23 10:11:24 +00:00
// Dependencies: [44, 2]
2026-07-20 16:05:17 +00:00
// Exports: getRoleSubscriptionMutationPlanId, getRoleSubscriptionPlanId
2026-07-28 08:39:19 +00:00
// Module 14209 (getRoleSubscriptionPlanId)
2026-07-23 10:11:24 +00:00
const result = require("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-07-23 10:11:24 +00:00
importDefault(44)(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;
if (null != renewalMutations) {
renewalMutations = renewalMutations.renewalMutations;
if (null != renewalMutations) {
items = renewalMutations.items;
}
}
if (null != items) {
2026-07-23 10:11:24 +00:00
importDefault(44)(items.length <= 1, "more than 1 renewal mutation for role subscription");
2026-07-20 16:05:17 +00:00
let planId;
if (null != items) {
planId = items[0].planId;
}
return planId;
}
};