package processor import ( "fmt" "github.com/slack-go/slack/socketmode" "houston/internal/processor/action" "houston/logger" "houston/pkg/slackbot" rcaService "houston/service/rca/impl" ) type ResolveIncidentCommandProcessor struct { socketModeClient *socketmode.Client resolveIncidentCommandAction *action.ResolveIncidentCommandAction rcaService *rcaService.RcaService } const ResolveIncidentCommandProcessorLogTag = "[start_incident_command_processor]" func NewResolveIncidentCommandProcessor( socketModeClient *socketmode.Client, slackBot *slackbot.Client, rcaService *rcaService.RcaService, ) *ResolveIncidentCommandProcessor { return &ResolveIncidentCommandProcessor{ socketModeClient: socketModeClient, resolveIncidentCommandAction: action.NewResolveIncidentCommandAction(socketModeClient, slackBot, rcaService), } } func (processor *ResolveIncidentCommandProcessor) ProcessSlashCommand(event *socketmode.Event) { defer func() { if r := recover(); r != nil { logger.Error(fmt.Sprintf("%s Exception occurred: %+v", ResolveIncidentCommandProcessorLogTag, r.(error))) } }() processor.resolveIncidentCommandAction.PerformAction(event) }