Core format string changes.

This commit is contained in:
Fletcher Boyd 2013-09-05 10:41:44 +08:00
parent 015dd93df3
commit 1ce777a5e4
3 changed files with 12 additions and 13 deletions

View file

@ -22,7 +22,7 @@ def censor(text):
if 'censored_strings' in bot.config:
if bot.config['censored_strings']:
words = map(re.escape, bot.config['censored_strings'])
regex = re.compile('(%s)' % "|".join(words))
regex = re.compile('({})'.format("|".join(words)))
text = regex.sub(replacement, text)
return text
@ -194,7 +194,7 @@ class IRC(object):
def join(self, channel):
""" makes the bot join a channel """
self.send("JOIN %s" % channel)
self.send("JOIN {}".format(channel))
if channel not in self.channels:
self.channels.append(channel)