mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-22 18:39:31 +01:00
Filter: Add uwu.
This commit is contained in:
parent
a7a03513bf
commit
b4d21127b1
@ -82,7 +82,7 @@ class Filter(callbacks.Plugin):
|
||||
_filterCommands = ['jeffk', 'leet', 'rot13', 'hexlify', 'binary',
|
||||
'scramble', 'morse', 'reverse', 'colorize', 'squish',
|
||||
'supa1337', 'stripcolor', 'aol', 'rainbow', 'spellit',
|
||||
'hebrew', 'undup', 'gnu', 'shrink', 'uniud', 'capwords',
|
||||
'hebrew', 'undup', 'uwu', 'gnu', 'shrink', 'uniud', 'capwords',
|
||||
'caps', 'vowelrot']
|
||||
@internationalizeDocstring
|
||||
def outfilter(self, irc, msg, args, channel, command):
|
||||
@ -754,6 +754,19 @@ class Filter(callbacks.Plugin):
|
||||
text = self._vowelrottrans(text)
|
||||
irc.reply(text)
|
||||
vowelrot = wrap(vowelrot, ['text'])
|
||||
|
||||
|
||||
_uwure = re.compile('[lr]')
|
||||
def uwu(self, irc, msg, args, text):
|
||||
"""<text>
|
||||
|
||||
Returns <text> in uwu-speak.
|
||||
"""
|
||||
text = self._uwure.sub('w', text)
|
||||
text += random.choice([''] * 10 + [' uwu', ' UwU', ' owo', ' OwO'])
|
||||
irc.reply(text)
|
||||
uwu = wrap(uwu, ['text'])
|
||||
|
||||
Filter = internationalizeDocstring(Filter)
|
||||
|
||||
Class = Filter
|
||||
|
@ -173,4 +173,11 @@ class FilterTest(ChannelPluginTestCase):
|
||||
self.assertResponse('shrink internationalization, localization',
|
||||
'i18n, l10n')
|
||||
|
||||
def testVowelrot(self):
|
||||
self.assertResponse('vowelrot foo bar baz', 'fuu ber bez')
|
||||
|
||||
def testUwu(self):
|
||||
for _ in range(100):
|
||||
self.assertRegexp('uwu foo bar baz', 'foo baw baz( [uoUO]w[uoUO])?')
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
Loading…
Reference in New Issue
Block a user