MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / buildCryptoToFiatResponse

Method buildCryptoToFiatResponse

rate/rate.ts:604–610  ·  view source on GitHub ↗
(amount: number, totalValue: number, price: number, cryptoSymbol: string, fiatSymbol: string, lastUpdated: Date)

Source from the content-addressed store, hash-verified

602 `💎 <b>当前汇率:</b> ${codeTag(`1 ${cryptoSymbol} = ${this.formatPrice(price)} ${fiatSymbol}`)}\n` +
603 `⏰ <b>数据更新:</b> ${lastUpdated.toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })}`;
604 }
605
606 private buildPriceResponse(price: number, cryptoSymbol: string, fiatSymbol: string, lastUpdated: Date): string {
607 return `💱 <b>汇率</b>\n\n` +
608 `${codeTag(`1 ${cryptoSymbol} = ${this.formatPrice(price)} ${fiatSymbol}`)}\n\n` +
609 `⏰ <b>数据更新:</b> ${lastUpdated.toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })}`;
610 }
611
612 private async handleRate(msg: Api.Message): Promise<void> {
613 const text = msg.text?.trim() || "";

Callers 1

handleRateMethod · 0.95

Calls 3

formatAmountMethod · 0.95
formatPriceMethod · 0.95
codeTagFunction · 0.70

Tested by

no test coverage detected