diff --git a/build.sbt b/build.sbt index 6761ca3..2a04d53 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ name := "TwitchIRC" -version := "0.1.1" +version := "0.1.3" scalaVersion := "2.12.5" diff --git a/src/main/scala/bot/twitchirc/TwitchIRCActor.scala b/src/main/scala/bot/twitchirc/TwitchIRCActor.scala index c5c7616..8c4ef48 100644 --- a/src/main/scala/bot/twitchirc/TwitchIRCActor.scala +++ b/src/main/scala/bot/twitchirc/TwitchIRCActor.scala @@ -34,7 +34,6 @@ class TwitchIRCActor(address: InetSocketAddress, nick: String, oauth: String, pr private val messageParser = new MessageParser(nick) private var listeners: Set[ActorRef] = Set.empty - private var sentMessages: Map[(String, String), Cancellable] = Map.empty private var joins: Map[String, Cancellable] = Map.empty private var parts: Map[String, Cancellable] = Map.empty private var channelsToUsers: Map[String, Seq[String]] = Map.empty @@ -106,9 +105,6 @@ class TwitchIRCActor(address: InetSocketAddress, nick: String, oauth: String, pr case PartConfirmation(channel) => parts.get(channel).foreach(_.cancel()) parts -= channel - case MessageDeliverConfirmation(channel, message) => - sentMessages.get((channel, message)).foreach(_.cancel()) - sentMessages -= ((channel, message)) case ChannelUserList(channel, users) => channelsToUsers += channel -> (users ++ channelsToUsers.getOrElse(channel, Seq())) @@ -149,10 +145,6 @@ class TwitchIRCActor(address: InetSocketAddress, nick: String, oauth: String, pr case SendMessage(name, message) => val channelName = name.toLowerCase tcpClientActor ! SendData(s"PRIVMSG $channelName :$message") - sentMessages += (channelName, message) -> context.system.scheduler.scheduleOnce(respondTimeout)({ - log.error(s"Twitch server doesn't respond PRIVMSG $channelName, $message request") - parts -= (channelName, message) - }) case SendWhisper(name, message) => val userName = name.toLowerCase tcpClientActor ! SendData(s"PRIVMSG #$nick :/w $userName $message") diff --git a/src/main/scala/bot/twitchirc/messages/Message.scala b/src/main/scala/bot/twitchirc/messages/Message.scala index 3d58af4..ce5d521 100644 --- a/src/main/scala/bot/twitchirc/messages/Message.scala +++ b/src/main/scala/bot/twitchirc/messages/Message.scala @@ -13,7 +13,6 @@ object Message { private[twitchirc] case class JoinConfirmation(channel: String) extends Message private[twitchirc] case class PartConfirmation(channel: String) extends Message - private[twitchirc] case class MessageDeliverConfirmation(channel: String, message: String) extends Message case class UserJoinedChannel(user: String, channel: String) extends Message case class UserLeftChannel(user: String, channel: String) extends Message diff --git a/src/main/scala/bot/twitchirc/messages/MessageParser.scala b/src/main/scala/bot/twitchirc/messages/MessageParser.scala index 62c4f45..2b07249 100644 --- a/src/main/scala/bot/twitchirc/messages/MessageParser.scala +++ b/src/main/scala/bot/twitchirc/messages/MessageParser.scala @@ -14,7 +14,6 @@ class MessageParser(nick: String) { private val pingRegexp = "PING :tmi.twitch.tv".r private val successfulJoin = s":$nick!$nick@$nick.tmi.twitch.tv JOIN ($nameTemplate)".r private val successfulPart = s":$nick!$nick@$nick.tmi.twitch.tv PART ($nameTemplate)".r - private val successfulPrivmsg = s":$nick!$nick@$nick.tmi.twitch.tv PRIVMSG ($nameTemplate) :(.*)".r //should be before incomingChatMessage //membership private val userJoinedChannel = s":($nameTemplate)!$nameTemplate@$nameTemplate.tmi.twitch.tv JOIN ($nameTemplate)".r @@ -47,7 +46,6 @@ class MessageParser(nick: String) { case pingRegexp() => Ping case successfulJoin(channel) => JoinConfirmation(channel) case successfulPart(channel) => PartConfirmation(channel) - case successfulPrivmsg(channel, message) => MessageDeliverConfirmation(channel, message) case userJoinedChannel(user, channel) => UserJoinedChannel(user, channel) case userLeftChannel(user, channel) => UserLeftChannel(user, channel)