Skip to content

Commit 8dfdec0

Browse files
committed
bug修复
1 parent 0423195 commit 8dfdec0

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/Telegram.CoinConvertBot/BgServices/BotHandler/UpdateHandlers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ async Task<Message> ConvertCoinTRX(ITelegramBotClient botClient, Message message
239239
实时汇率:<b>1 USDT = {2m.USDT_To_TRX(rate, FeeRate):#.####} TRX</b>
240240
获得TRX:<b>(10 - 1) * {2m.USDT_To_TRX(rate, FeeRate):#.####} = {9m.USDT_To_TRX(rate, FeeRate):0.00} TRX</b></code>
241241
242-
注意:<b>暂时只支持{MinUSDT} USDT以上(不含{MinUSDT} USDT)的金额兑换,若转入{MinUSDT} USDT及以下金额,将无法退还!!!</b>
242+
注意:<b>只支持{MinUSDT} USDT以上的金额兑换。</b>
243243
244244
转帐前,推荐您使用以下命令来接收入账通知
245245
<code>绑定波场地址 Txxxxxxx</code>(您的钱包地址)
@@ -348,7 +348,7 @@ static async Task<Message> ValuationAction(ITelegramBotClient botClient, Message
348348
var msg = $"<b>{price} {fromCurrency} = {price} {fromCurrency}</b>";
349349
if (fromCurrency == Currency.USDT && toCurrency == Currency.TRX)
350350
{
351-
if (price <= MinUSDT)
351+
if (price < MinUSDT)
352352
{
353353
msg = $"仅支持大于{MinUSDT} USDT 的兑换";
354354
}
@@ -361,7 +361,7 @@ static async Task<Message> ValuationAction(ITelegramBotClient botClient, Message
361361
if (fromCurrency == Currency.TRX && toCurrency == Currency.USDT)
362362
{
363363
var toPrice = price.TRX_To_USDT(rate, FeeRate);
364-
if (toPrice <= MinUSDT)
364+
if (toPrice < MinUSDT)
365365
{
366366
msg = $"仅支持大于{MinUSDT} USDT 的兑换";
367367
}

src/Telegram.CoinConvertBot/BgServices/TransferTrxService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected override async Task ExecuteAsync()
5353
}
5454
var Orders = await _repository
5555
.Where(x => x.Status == Status.Pending)
56-
.Where(x => x.OriginalAmount > UpdateHandlers.MinUSDT)
56+
.Where(x => x.OriginalAmount >= UpdateHandlers.MinUSDT)
5757
.ToListAsync();
5858
if (Orders.Count > 0)
5959
_logger.LogInformation("待转账订单检测,订单数:{c}", Orders.Count);

src/Telegram.CoinConvertBot/BgServices/USDT_TRC20Service.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,10 @@ protected override async Task ExecuteAsync()
8383
foreach (var item in result.Data)
8484
{
8585
//合约地址不匹配
86-
if (item.TokenInfo?.Address != ContractAddress)
87-
{
88-
continue;
89-
}
86+
if (item.TokenInfo?.Address != ContractAddress) continue;
87+
var types = new string[] { "Transfer", "TransferFrom" };
9088
//收款地址相同
91-
if (item.To != address) continue;
89+
if (item.To != address || !types.Contains(item.Type)) continue;
9290
//实际支付金额
9391
var amount = item.Amount;
9492
var record = new TokenRecord

0 commit comments

Comments
 (0)