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
This commit is contained in:
36
internal/processor/set_description_command_processor.go
Normal file
36
internal/processor/set_description_command_processor.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package processor
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/slack-go/slack/socketmode"
|
||||
"houston/internal/processor/action"
|
||||
"houston/logger"
|
||||
"houston/pkg/slackbot"
|
||||
)
|
||||
|
||||
type SetDescriptionCommandProcessor struct {
|
||||
socketModeClient *socketmode.Client
|
||||
setDescriptionCommandAction *action.SetDescriptionCommandAction
|
||||
}
|
||||
|
||||
const setDescriptionCommandProcessorLogTag = "[set_description_command_processor]"
|
||||
|
||||
func NewSetDescriptionCommandProcessor(
|
||||
socketModeClient *socketmode.Client,
|
||||
slackBot *slackbot.Client,
|
||||
) *SetDescriptionCommandProcessor {
|
||||
return &SetDescriptionCommandProcessor{
|
||||
socketModeClient: socketModeClient,
|
||||
setDescriptionCommandAction: action.NewSetDescriptionCommandAction(socketModeClient, slackBot),
|
||||
}
|
||||
}
|
||||
|
||||
func (processor *SetDescriptionCommandProcessor) ProcessSlashCommand(event *socketmode.Event) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
logger.Error(fmt.Sprintf("%s Exception occurred: %+v", setDescriptionCommandProcessorLogTag, r.(error)))
|
||||
}
|
||||
}()
|
||||
|
||||
processor.setDescriptionCommandAction.PerformAction(event)
|
||||
}
|
||||
Reference in New Issue
Block a user