SantioMC / MinehutUtils

The core behind the Minehut bot in discord.gg/Minehut
https://discord.gg/Minehut
Apache License 2.0
4 stars 6 forks source link

reduce code length #3

Closed Greenlio closed 2 years ago

Greenlio commented 2 years ago

updates to use activeServerPlan instead of splitting and using plan or rawPlan not sure how exports work in ts so someone should update export type i was bored and this is much easier and better to look at

SantioMC commented 2 years ago

This value is very inconsistent (especially for yearly plans) which is why I decided to not use it. I'll show some examples of what I mean

{ rawPlan: "MONTHLY_3gb", activeServerPlan: "MH35" } { rawPlan: "YEARLY_10gb" activeServerPlan: "YEARLY MH Unlimited" } { rawPlan: "MONTHLY_10gb", activeServerPlan: "MH Unlimited" }

Greenlio commented 2 years ago

Inconsistent? How so? rawPlan just tells you the max memory and how long it is while activeServerPlan formats it for you and everything. Is there any real downside to the change in code?

SantioMC commented 2 years ago

Yeah, with the ram we can get the plan exactly, also the inconsistency lies between the plan payment interval, it's also far too long which causes the embed to look janky image image