diff --git a/.gitignore b/.gitignore index d8b6c30..f1d5ff7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # App-specific settings.json +settings.demo.json data/*.json irc/ diff --git a/actions/botlist.py b/actions/botlist.py index 1766a02..54ce622 100644 --- a/actions/botlist.py +++ b/actions/botlist.py @@ -8,7 +8,10 @@ def botlist(self, name, source, response): "!rollcall", "!summon", "!banish", - "!pardon" + "!pardon", + "!hmmscore", + "!hmmscoreboard", + "!whois" ]) args = (botnick, author, email, about, commands) message = "{} | {} <{}> | {} | {}".format(*args) diff --git a/app.py b/app.py index d0f6d54..4e170e3 100755 --- a/app.py +++ b/app.py @@ -9,10 +9,15 @@ from coroutines import coroutines debug = False kingme = [] if debug else ["#chaos"] channels = ["#bots", "#insane"] -# if not debug: -# channels.extend([]) +if not debug: + channels.extend([ + "#meta", + "#team", + "#chaos", + "#tildeverse" + ]) -bot = Bot("127.0.0.1", 6667, "BabiliBot|py", channels) +bot = Bot("127.0.0.1", 6667, "BabiliBot", channels) responses = Responses(bot) tasks = Tasks(bot) diff --git a/bot/responses.py b/bot/responses.py index dfacd2d..ae50f6e 100644 --- a/bot/responses.py +++ b/bot/responses.py @@ -17,6 +17,9 @@ class Responses: def allowed(self, name, source): memories = self.bot.memories users = memories["users"] + if name not in users: + return False + if name in users and "blacklist" in users[name]: reason = users[name]["blacklist"]["reason"] message = "is ignoring {} for reason '{}'".format(name, reason) @@ -41,6 +44,11 @@ class Responses: return True def parse(self, name, source, response): + users = self.bot.memories["users"] + if name not in users: + return False + + response = response.lower() check = { "name": name, "source": source, diff --git a/coroutines/__init__.py b/coroutines/__init__.py index fc344f0..bd7b4da 100644 --- a/coroutines/__init__.py +++ b/coroutines/__init__.py @@ -15,7 +15,7 @@ coroutines = [ "state": { "alias": "bbj", "source": "http://localhost:7099/api", - "channels": ["#bots"] #team + "channels": ["#team"] } }, { @@ -25,7 +25,7 @@ coroutines = [ "alias": "title", "source": "https://tilde.news/newest.rss", "use": "title", - "channels": ["#bots"] # "#meta", "#tildeverse" + "channels": ["#meta", "#tildeverse"] } }, { @@ -35,7 +35,7 @@ coroutines = [ "alias": "links-comments", "source": "https://tilde.news/comments.rss", "use": "summary", - "channels": ["#bots"] #tildeverse + "channels": ["#tildeverse"] } } ] \ No newline at end of file diff --git a/coroutines/rss.py b/coroutines/rss.py index 90dcd44..b24d3c1 100644 --- a/coroutines/rss.py +++ b/coroutines/rss.py @@ -49,7 +49,7 @@ class RSS: self.memory["known"].append(guid) - use = sub(r"(<\/?[^>]+>)|\\n", "", item.findtext([self.use], "")) + use = sub(r"(<\/?[^>]+>)|\\n", "", item.findtext(self.use, "")) user = item.findtext("author", "").split("@")[0] post = "{} (posted by {}) <{}>".format(use, user, guid) response = "[{}] {}".format(self.alias, post)