From 1c98e9a8d13e59b9ae4c5b8106bf6be78ba80558 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 21 Dec 2013 19:34:26 +0000 Subject: [PATCH] Coinpan: enhance some triggers, add extra actions on replacer clash. --- Coinpan/plugin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Coinpan/plugin.py b/Coinpan/plugin.py index 798a390..61354f0 100644 --- a/Coinpan/plugin.py +++ b/Coinpan/plugin.py @@ -56,7 +56,6 @@ def replacer(match): strike = 'Ø' in coin if strike: coin = coin.replace('Ø', 'o') - coin = coin.replace('Ο', 'O') pan = '' if coin[0] in 'ck': pan += 'p' @@ -81,7 +80,12 @@ def replacer(match): elif coin[1:3] in 'ôi ôî oî'.split(' '): pan += 'â' elif coin[1] in 'ôÔöÖ' and coin[2] in 'îÎïÏ': - return 'COINCOINCOINPANPANPAN' + if coin[0] in 'kK': + return'KOINKOINKOINPANGPANGPANG' + elif coin[0] in 'ĉĈ': + return'ĈOINĈOINĈOINPANPANPAN' + else: + return'COINCOINCOINPANPANPAN' elif coin[1] == 'O' or coin[2] == 'I': pan += 'A' elif coin[1] == 'o' and coin[2] == 'i': @@ -113,9 +117,11 @@ def snarfer_generator(): if self.registryValue('enable', msg.args[0]): txt = msg.args[1] txt = txt.replace('\u200b', '') + txt = txt.replace('Ο', 'O') txt = txt.replace('>o_/', '>x_/').replace('\_o<', '\_x<') + txt = txt.replace('>O_/', '>x_/').replace('\_O<', '\_x<') irc.reply(_regexp.sub(replacer, txt), prefixNick=False) - regexp = '(?i).*(%s|>^o^_^/|\^_^o^<).*' % REGEXP + regexp = '(?i).*(%s|>^o^_^/|\^_^[Oo]^<).*' % REGEXP regexp = regexp.replace('^', '\u200b*') coinSnarfer.__doc__ = regexp return coinSnarfer