Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Commit

Permalink
Escape user inputs. Add connected servers count on startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
mart-w committed Sep 29, 2017
1 parent 5197d1f commit 6ec2098
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions parrotbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def search_message_by_quote(self, quote):
if not match["author"] \
or await self.is_same_user(message.author, match["author"]):
if re.search( \
match["content"], \
re.escape(match["content"]), \
message.content, \
flags=re.IGNORECASE \
):
Expand Down Expand Up @@ -195,8 +195,9 @@ async def quote_message(self, quote):
# Event listeners.

async def on_ready(self):
"""Print that the bot is ready."""
"""Print that the bot is ready and list connected servers."""
print("ParrotBot is ready.")
print("Connected Servers: %d\n" % (len(self.servers)))

async def on_server_join(self, server):
"""Print number of connected servers when connecting to a new server."""
Expand Down

0 comments on commit 6ec2098

Please sign in to comment.