From 123b370aa19e65864f1986e9f62cdeb511fa4fbd Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Wed, 3 Jul 2019 11:04:33 +0200 Subject: irc: Do not respond when not addressed directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes annoying messages when using the bot’s nick as the first word of a message, i.e. “chromebot can do that”. --- crocoite/irc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crocoite') diff --git a/crocoite/irc.py b/crocoite/irc.py index d0b5bb9..0803398 100644 --- a/crocoite/irc.py +++ b/crocoite/irc.py @@ -366,7 +366,7 @@ class ArgparseBot (bottom.Client): async def onMessage (self, nick, target, message, **kwargs): """ Message received """ - if target in self.channels and message.startswith (self.nick): + if target in self.channels and message.startswith (self.nick + ':'): user = self.users[target].get (nick, User (nick)) reply = ReplyContext (client=self, target=target, user=user) -- cgit v1.2.3