Update fetch borkerPosition in bot + better HandleClosePosition + Add debug channel to receive all debug

This commit is contained in:
2025-10-25 18:35:51 +07:00
parent 38e6998ff3
commit f816b8de50
9 changed files with 229 additions and 98 deletions

View File

@@ -503,6 +503,19 @@ namespace Managing.Infrastructure.Messengers.Discord
}
}
public async Task SendDebugMessage(string message)
{
try
{
var channel = _client.GetChannel(_settings.DebugChannelId) as IMessageChannel;
await channel.SendMessageAsync(message);
}
catch (Exception e)
{
SentrySdk.CaptureException(e);
}
}
public async Task SendClosedPosition(string address, Trade oldTrade)
{
var fields = new List<EmbedFieldBuilder>()

View File

@@ -18,12 +18,14 @@ namespace Managing.Infrastructure.Messengers.Discord
ButtonExpirationMinutes = config.GetValue<int>("Discord:ButtonExpirationMinutes");
HandleUserAction = config.GetValue<bool>("Discord:HandleUserAction");
BotActivity = config.GetValue<string>("Discord:BotActivity");
DebugChannelId = config.GetValue<ulong>("Discord:DebugChannelId");
BotEnabled = true;
}
public int ButtonExpirationMinutes { get; set; }
public bool HandleUserAction { get; }
public string BotActivity { get; }
public ulong DebugChannelId { get; }
public string Token { get; }
public ulong SignalChannelId { get; }
public ulong CopyTradingChannelId { get; }