feat: Bot management improvements with wallet configuration and duplicate detection
This commit is contained in:
@@ -54,6 +54,25 @@ public class BotsController : ControllerBase
|
||||
return Ok(bot);
|
||||
}
|
||||
|
||||
[HttpGet("by-platform/{platformType}/{platformUsername}")]
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult<BotDto>> GetBotByPlatformUsername(int platformType, string platformUsername)
|
||||
{
|
||||
try
|
||||
{
|
||||
var bot = await _botService.GetBotByPlatformUsernameAsync(platformType, platformUsername);
|
||||
if (bot == null)
|
||||
return NotFound($"Bot not found for platform {platformType} with username {platformUsername}");
|
||||
|
||||
return Ok(bot);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Failed to find bot by platform username {Platform}/@{Username}", platformType, platformUsername);
|
||||
return StatusCode(500, "Internal server error");
|
||||
}
|
||||
}
|
||||
|
||||
// Bot Settings
|
||||
[HttpGet("settings")]
|
||||
public async Task<ActionResult<Dictionary<string, object>>> GetBotSettings()
|
||||
|
||||
Reference in New Issue
Block a user