Fixups
This commit is contained in:
@@ -47,7 +47,10 @@ func (t *Slack) AgentReasoningCallback() func(state agent.ActionCurrentState) bo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func cleanUpUsernameFromMessage(message string, b *slack.AuthTestResponse) string {
|
func cleanUpUsernameFromMessage(message string, b *slack.AuthTestResponse) string {
|
||||||
return strings.ReplaceAll(message, "<@"+b.BotID+">", "")
|
cleaned := strings.ReplaceAll(message, "<@"+b.UserID+">", "")
|
||||||
|
cleaned = strings.ReplaceAll(message, "<@"+b.BotID+">", "")
|
||||||
|
cleaned = strings.TrimSpace(cleaned)
|
||||||
|
return cleaned
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Slack) Start(a *agent.Agent) {
|
func (t *Slack) Start(a *agent.Agent) {
|
||||||
@@ -105,8 +108,7 @@ func (t *Slack) Start(a *agent.Agent) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
message := ev.Text
|
message := cleanUpUsernameFromMessage(ev.Text, b)
|
||||||
message = cleanUpUsernameFromMessage(message, b)
|
|
||||||
go func() {
|
go func() {
|
||||||
|
|
||||||
ts := ev.ThreadTimeStamp
|
ts := ev.ThreadTimeStamp
|
||||||
@@ -129,10 +131,9 @@ func (t *Slack) Start(a *agent.Agent) {
|
|||||||
// Skip messages from ourselves
|
// Skip messages from ourselves
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
message := ev.Text
|
message := cleanUpUsernameFromMessage(ev.Text, b)
|
||||||
|
|
||||||
// strip our id from the message
|
// strip our id from the message
|
||||||
message = cleanUpUsernameFromMessage(message, b)
|
|
||||||
xlog.Info("Message", message)
|
xlog.Info("Message", message)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user