Add agentname in message
This commit is contained in:
@@ -14,6 +14,7 @@ public class AccountService : IAccountService
|
||||
private readonly IEvmManager _evmManager;
|
||||
private readonly ICacheService _cacheService;
|
||||
private readonly IWeb3ProxyService _web3ProxyService;
|
||||
private readonly IUserRepository _userRepository;
|
||||
private readonly ILogger<AccountService> _logger;
|
||||
|
||||
public AccountService(
|
||||
@@ -22,7 +23,8 @@ public class AccountService : IAccountService
|
||||
IExchangeService exchangeService,
|
||||
IEvmManager evmManager,
|
||||
ICacheService cacheService,
|
||||
IWeb3ProxyService web3ProxyService)
|
||||
IWeb3ProxyService web3ProxyService,
|
||||
IUserRepository userRepository)
|
||||
{
|
||||
_accountRepository = accountRepository;
|
||||
_logger = logger;
|
||||
@@ -30,6 +32,7 @@ public class AccountService : IAccountService
|
||||
_evmManager = evmManager;
|
||||
_cacheService = cacheService;
|
||||
_web3ProxyService = web3ProxyService;
|
||||
_userRepository = userRepository;
|
||||
}
|
||||
|
||||
public async Task<Account> CreateAccount(User user, Account request)
|
||||
@@ -99,6 +102,8 @@ public class AccountService : IAccountService
|
||||
var account = await _accountRepository.GetAccountByNameAsync(name);
|
||||
ManageProperties(hideSecrets, getBalance, account);
|
||||
|
||||
account.User = await _userRepository.GetUserByNameAsync(account.User.Name);
|
||||
|
||||
return account;
|
||||
}
|
||||
|
||||
|
||||
@@ -1353,9 +1353,10 @@ public class TradingBot : Bot, ITradingBot
|
||||
{
|
||||
if (!Config.IsForBacktest)
|
||||
{
|
||||
var user = Account.User;
|
||||
// Add bot name at the top of every message
|
||||
var messageWithBotName = $"🤖 **{Name}**\n{message}";
|
||||
await MessengerService.SendTradeMessage(messageWithBotName, isBadBehavior, Account?.User);
|
||||
var messageWithBotName = $"🤖 **{user.AgentName} - {Name}**\n{message}";
|
||||
await MessengerService.SendTradeMessage(messageWithBotName, isBadBehavior, user);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user