abstract away prefix + ev cmd
All checks were successful
Deploy bot / build-and-deploy (push) Successful in 14s
All checks were successful
Deploy bot / build-and-deploy (push) Successful in 14s
This commit is contained in:
@ -128,9 +128,10 @@ function weightedInterpolatePrice(pricesArr, inputNum, p = 2) {
|
||||
exports.name = "estimate";
|
||||
exports.description =
|
||||
":money_with_wings: Give an estimated price of certain items in cv.";
|
||||
exports.usage = "<<estimate [summary of item you want the price of]";
|
||||
exports.usage =
|
||||
"CLIENT_PREFIX:estimate [summary of item you want the price of]";
|
||||
exports.example =
|
||||
"<<estimate 1600 ab2\n<<estimate 1100 thp\n<<estimate 2400 app builder staff\n(you can also include `showtable` anywhere to show raw price data)\n(always put number first, do not put conflicting data to avoid confusion)";
|
||||
"CLIENT_PREFIX:estimate 1600 ab2\nCLIENT_PREFIX:estimate 1100 thp\nCLIENT_PREFIX:estimate 2400 app builder staff\n(you can also include `showtable` anywhere to show raw price data)\n(always put number first, do not put conflicting data to avoid confusion)";
|
||||
exports.hidden = false;
|
||||
exports.run = async (client, message, args) => {
|
||||
if (!args[0]) {
|
||||
@ -139,7 +140,7 @@ exports.run = async (client, message, args) => {
|
||||
tbl += p.returnKeyWord + "\n";
|
||||
});
|
||||
return message.channel
|
||||
.send(`Available items in pricing table:\n\`\`\`\n${tbl}\`\`\`\nFor usage, consult \`<<help estimate\`
|
||||
.send(`Available items in pricing table:\n\`\`\`\n${tbl}\`\`\`\nFor usage, consult \`CLIENT_PREFIX:help estimate\`.replaceAll("CLIENT_PREFIX:", client.prefix)
|
||||
`);
|
||||
}
|
||||
const combined = args.join(" ");
|
||||
@ -156,7 +157,10 @@ exports.run = async (client, message, args) => {
|
||||
});
|
||||
if (!gameValue) {
|
||||
return message.channel.send(
|
||||
"You didn't include any numbers in your query. Try again or consult `<<help estimate`."
|
||||
"You didn't include any numbers in your query. Try again or consult `CLIENT_PREFIX:help estimate`.".replaceAll(
|
||||
"CLIENT_PREFIX:",
|
||||
client.prefix
|
||||
)
|
||||
);
|
||||
}
|
||||
priceTable.forEach((price, idx) => {
|
||||
@ -200,6 +204,9 @@ exports.run = async (client, message, args) => {
|
||||
}
|
||||
} else
|
||||
message.channel.send(
|
||||
"Your query couldn't be matched with anything, please refine your query or reffer to `<<help estimate` or use `<<estimate` to see all available price tables for more information."
|
||||
"Your query couldn't be matched with anything, please refine your query or reffer to `CLIENT_PREFIX:help estimate` or use `CLIENT_PREFIX:estimate` to see all available price tables for more information.".replaceAll(
|
||||
"CLIENT_PREFIX:",
|
||||
client.prefix
|
||||
)
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user