Send first message after connect (slack). Closes #252

This commit is contained in:
Wim 2017-09-07 23:47:23 +02:00
parent 01badde21d
commit a3470f8aec

View File

@ -257,12 +257,9 @@ func (b *Bslack) handleSlack() {
}
func (b *Bslack) handleSlackClient(mchan chan *MMMessage) {
count := 0
for msg := range b.rtm.IncomingEvents {
switch ev := msg.Data.(type) {
case *slack.MessageEvent:
// ignore first message
if count > 0 {
flog.Debugf("Receiving from slackclient %#v", ev)
if len(ev.Attachments) > 0 {
// skip messages we made ourselves
@ -314,8 +311,6 @@ func (b *Bslack) handleSlackClient(mchan chan *MMMessage) {
}
}
mchan <- m
}
count++
case *slack.OutgoingErrorEvent:
flog.Debugf("%#v", ev.Error())
case *slack.ChannelJoinedEvent: