Skip to content

Commit

Permalink
fix(ask.cmd.ts): adjust the limit for regenerated questions based on …
Browse files Browse the repository at this point in the history
…user's premium status

fix(premium.config.ts): update the description of regenerated questions to use "credits" instead of "uses"
fix(request.cmd.ts): adjust the limit for regenerated questions based on user's premium status and add support for up to 10 regenerated questions
  • Loading branch information
Steellgold committed Sep 1, 2023
1 parent 6a3331a commit f65043a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/commands/ask/ask.cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ export const execute: CommandExecute = async(command, user) => {
break;
case "regenerate":
regenerated++;
if (regenerated <= (user.isPremium ? 5 : 3)) await handleRespond(true);
if (regenerated <= (user.isPremium ? 10 : 2)) await handleRespond(true);

if (regenerated >= (user.isPremium ? 5 : 3)) {
if (regenerated >= (user.isPremium ? 10 : 2)) {
regeneratedLocked = true;
command.editReply({ components: buttonsBuilder(
url ?? null,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/premium/premium.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const premium = {
"• You have priority access to support",
"• You have 50% more writing power on your questions and discussions",
"• Download discussions when finished",
"• Regenerate your questions 10 times (per question) and not use your uses for it",
"• Regenerate your questions 10 times (per question) and not use your credits for it",
"• Your cooldown for {cmdAsk} is `5 seconds` instead of `10 seconds`",
"\n**How do I become premium and how much does it cost ?**",
"• You can become premium by clicking on the button below, for a total of $5,00 per month.",
Expand Down
11 changes: 8 additions & 3 deletions src/commands/request/request.cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,20 @@ export const execute: CommandExecute = async(command, user) => {
else rowConfig = { row1max: 2, row2max: 5, row3max: 5, row4max: 5, row5max: 5 };

const updateButtons = (): ButtonBuilder[] => {
const emojis = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣"];
const emojis = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"];
const buttons: ButtonBuilder[] = [];

buttons.push(simpleButton(undefined, ButtonStyle.Secondary, "initial", inInitialResponse, { name: "📄" }));

if (data.history.length == 0) {
for (let i = 0; i < (user.isPremium ? 5 : 3); i++) {
for (let i = 0; i < (user.isPremium ? 10 : 2); i++) {
buttons.push(simpleButton(undefined, ButtonStyle.Secondary, `p${i + 1}`, true, { name: emojis[i] }));
}

return buttons;
}

for (let i = 0; i < (user.isPremium ? 5 : 3); i++) {
for (let i = 0; i < (user.isPremium ? 10 : 2); i++) {
buttons.push(simpleButton(
undefined,
ButtonStyle.Secondary,
Expand Down Expand Up @@ -155,6 +155,11 @@ export const execute: CommandExecute = async(command, user) => {
case "p3":
case "p4":
case "p5":
case "p6":
case "p7":
case "p8":
case "p9":
case "p10":
inInitialResponse = false;
actualPage = parseInt(interaction.customId.replace("p", ""));

Expand Down

0 comments on commit f65043a

Please sign in to comment.