func (bot *gigoBot) InfoMessage(room *gitterClient.RoomStruct, Message string, second int) *time.Ticker { ticker := time.NewTicker(time.Duration(second) * time.Second) go func() { for range ticker.C { room.SafeSendMessage(Message) } }() return ticker }
func (bot *gigoBot) messageHandler(room *gitterClient.RoomStruct, message gitterClient.MessageStruct) { log.Print(message.FromUser.Username, " -> ", room.Url, ": ", message.Text) room.SendMessage("@" + message.FromUser.Username + " Не пойму о чем вы :(") }
func (bot *gigoBot) AddLisner(room *gitterClient.RoomStruct) { bot.rooms = append(bot.rooms, room) go room.Join() }