Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record CHANNEL_ID's log #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ func (s *SlackListener) ListenAndResponse() {
func (s *SlackListener) handleMessageEvent(ev *slack.MessageEvent) error {
// Only response in specific channel. Ignore else.
if ev.Channel != s.channelID {
log.Printf("%s %s", ev.Channel, ev.Msg.Text)
return nil
}
log.Printf("%s %s", ev.Channel, ev.Msg.Text)

// Only response mention to bot. Ignore else.
if !strings.HasPrefix(ev.Msg.Text, fmt.Sprintf("<@%s> ", s.botID)) {
Expand Down