Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

!rate properly displays a rate #1780

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/classes/Commands/sub-classes/Misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,23 @@ export default class MiscCommands {
);
} else if (command === 'rate') {
const key = this.bot.pricelist.getKeyPrices;
const keyRate = key.sell.toString();
const keySellRate = key.sell.toString();
const keyBuyRate = key.buy.toString();

this.bot.sendMessage(
steamID,
custom
? custom
.replace(/%keyRate%/g, keyRate)
.replace(/%keyPrices%/g, `${key.buy.metal} / ${key.sell.toString()}`)
.replace(/%keySellRate%/g, keySellRate)
.replace(/%keyBuyRate%/g, keyBuyRate)
.replace(/%keyPrices%/g, `${keyBuyRate} / ${keySellRate}`)
: 'I value 🔑 Mann Co. Supply Crate Keys at ' +
keyRate +
'. This means that one key is the same as ' +
keyRate +
', and ' +
keyRate +
' is the same as one key.'
`${keyBuyRate} / ${keySellRate}` +
'. This means that I buy one key for ' +
keyBuyRate +
', and I sell one key for ' +
keySellRate +
'.'
);
} else if (command === 'owner') {
const firstAdmin = this.bot.getAdmins[0];
Expand Down