@@ -70,17 +70,19 @@ export async function generatePremiumEmbed(premiumInfo: {
70
70
for ( const expense of user . plan . expenses ) {
71
71
if ( expensesFields . length >= 10 ) break ;
72
72
expensesFields . push ( {
73
- name : `${ expense . type . slice ( 0 , 1 ) . toUpperCase ( ) } ${ expense . type . slice ( 1 ) } - using \`${ expense . data . model } \` - $${ expense . used ?. toFixed ( 5 ) ?? "0"
74
- } `,
73
+ name : `${ expense . type . slice ( 0 , 1 ) . toUpperCase ( ) } ${ expense . type . slice ( 1 ) } - using \`${ expense . data . model } \` - $${
74
+ expense . used ?. toFixed ( 5 ) ?? "0"
75
+ } `,
75
76
value : `<t:${ Math . floor ( expense . time / 1000 ) } :R>` ,
76
77
} ) ;
77
78
}
78
79
} else if ( premiumInfo . premiumSelection . location === "guild" && guild ?. plan ) {
79
80
for ( const expense of guild . plan . expenses ) {
80
81
if ( expensesFields . length >= 10 ) break ;
81
82
expensesFields . push ( {
82
- name : `${ expense . type . slice ( 0 , 1 ) . toUpperCase ( ) } ${ expense . type . slice ( 1 ) } - using \`${ expense . data . model } \` - $${ expense . used ?. toFixed ( 5 ) ?? "0"
83
- } `,
83
+ name : `${ expense . type . slice ( 0 , 1 ) . toUpperCase ( ) } ${ expense . type . slice ( 1 ) } - using \`${ expense . data . model } \` - $${
84
+ expense . used ?. toFixed ( 5 ) ?? "0"
85
+ } `,
84
86
value : `<t:${ Math . floor ( expense . time / 1000 ) } >` ,
85
87
} ) ;
86
88
}
@@ -98,8 +100,9 @@ export async function generatePremiumEmbed(premiumInfo: {
98
100
for ( const charge of user . plan . history ) {
99
101
if ( chargesFields . length >= 10 ) break ;
100
102
chargesFields . push ( {
101
- name : `${ charge . type . slice ( 0 , 1 ) . toUpperCase ( ) } ${ charge . type . slice ( 1 ) } ${ charge . gateway ? `- using \`${ charge . gateway } \`` : ""
102
- } `,
103
+ name : `${ charge . type . slice ( 0 , 1 ) . toUpperCase ( ) } ${ charge . type . slice ( 1 ) } ${
104
+ charge . gateway ? `- using \`${ charge . gateway } \`` : ""
105
+ } `,
103
106
value : `$${ charge . amount ?. toFixed ( 2 ) ?? "0" } - <t:${ Math . floor ( charge . time / 1000 ) } >` ,
104
107
} ) ;
105
108
}
@@ -108,8 +111,9 @@ export async function generatePremiumEmbed(premiumInfo: {
108
111
for ( const charge of guild . plan . history ) {
109
112
if ( chargesFields . length >= 10 ) break ;
110
113
chargesFields . push ( {
111
- name : `${ charge . type . slice ( 0 , 1 ) . toUpperCase ( ) } ${ charge . type . slice ( 1 ) } ${ charge . gateway ? `- using \`${ charge . gateway } \`` : ""
112
- } `,
114
+ name : `${ charge . type . slice ( 0 , 1 ) . toUpperCase ( ) } ${ charge . type . slice ( 1 ) } ${
115
+ charge . gateway ? `- using \`${ charge . gateway } \`` : ""
116
+ } `,
113
117
value : `$${ charge . amount ?. toFixed ( 2 ) } - <t:${ Math . floor ( charge . time / 1000 ) } >` ,
114
118
} ) ;
115
119
}
@@ -126,11 +130,13 @@ export async function generatePremiumEmbed(premiumInfo: {
126
130
// LAST EMBED
127
131
let description = "" ;
128
132
if ( premiumInfo . premiumSelection . location === "user" && user . plan ) {
129
- description = `**$${ user . plan ?. used ?. toFixed ( 2 ) } **\`${ generateProgressBar ( user . plan . total , user . plan . used ) } \`**$${ user . plan ?. total
130
- } **`;
133
+ description = `**$${ user . plan ?. used ?. toFixed ( 2 ) } **\`${ generateProgressBar ( user . plan . total , user . plan . used ) } \`**$${
134
+ user . plan ?. total
135
+ } **`;
131
136
} else if ( premiumInfo . premiumSelection . location === "guild" && guild ?. plan ) {
132
- description = `**$${ guild . plan ?. used ?. toFixed ( 2 ) } **\`${ generateProgressBar ( guild . plan . total , guild . plan . used ) } \`**$${ guild . plan ?. total
133
- } **`;
137
+ description = `**$${ guild . plan ?. used ?. toFixed ( 2 ) } **\`${ generateProgressBar ( guild . plan . total , guild . plan . used ) } \`**$${
138
+ guild . plan ?. total
139
+ } **`;
134
140
}
135
141
embeds . push ( {
136
142
title : "Your pay-as-you-go plan 📊" ,
@@ -276,7 +282,6 @@ export async function chargePlan(cost: number, environment: Environment, type: "
276
282
return false ;
277
283
}
278
284
// if is not expired do nothing
279
-
280
285
} else if ( prem . location === "guild" ) {
281
286
if ( ! environment . guild ?. subscription ) return false ;
282
287
const subscription = environment . guild . subscription ;
0 commit comments