Files
houston-be/internal/processor/set_status_command_processor.go
Shashank Shekhar 88459577f4 TP-49403 | parameterized slash command (#297)
* TP-49403 | parameterized slash command

* TP-49403 | handeling resolve and rca params also implemented Help-Commands button

* TP-49403 | using command pattern for command resolutiuon and execution

* TP-49403 | made find team by name and find severity by name queries case insensitive

* TP-49403 | updating help message keys
2023-11-30 11:56:32 +05:30

37 lines
987 B
Go

package processor
import (
"fmt"
"github.com/slack-go/slack/socketmode"
"houston/internal/processor/action"
"houston/logger"
"houston/pkg/slackbot"
)
type SetStatusCommandProcessor struct {
socketModeClient *socketmode.Client
setStatusCommandAction *action.SetStatusCommandAction
}
const setStatusCommandProcessorLogTag = "[set_status_command_processor]"
func NewSetStatusCommandProcessor(
socketModeClient *socketmode.Client,
slackBot *slackbot.Client,
) *SetStatusCommandProcessor {
return &SetStatusCommandProcessor{
socketModeClient: socketModeClient,
setStatusCommandAction: action.NewSetStatusCommandAction(socketModeClient, slackBot),
}
}
func (processor *SetStatusCommandProcessor) ProcessSlashCommand(event *socketmode.Event) {
defer func() {
if r := recover(); r != nil {
logger.Error(fmt.Sprintf("%s Exception occurred: %+v", setStatusCommandProcessorLogTag, r.(error)))
}
}()
processor.setStatusCommandAction.PerformAction(event)
}