mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added a squish command/outfilter.
This commit is contained in:
parent
93b16b79c2
commit
f3e2e2a1ed
@ -77,7 +77,7 @@ class Fun(callbacks.Privmsg):
|
||||
|
||||
_filterCommands = ['jeffk', 'leet', 'rot13', 'hexlify', 'binary', 'lithp',
|
||||
'scramble', 'morse', 'reverse', 'urlquote', 'md5','sha',
|
||||
'colorize']
|
||||
'colorize', 'squish']
|
||||
def outfilter(self, irc, msg, args, channel):
|
||||
"""[<channel>] [<command>]
|
||||
|
||||
@ -99,6 +99,15 @@ class Fun(callbacks.Privmsg):
|
||||
irc.reply(msg, conf.replySuccess)
|
||||
outfilter = privmsgs.checkChannelCapability(outfilter, 'op')
|
||||
|
||||
def squish(self, irc, msg, args):
|
||||
"""<text>
|
||||
|
||||
Removes all the spaces from <text>.
|
||||
"""
|
||||
text = privmsgs.getArgs(args)
|
||||
text = ''.join(text.split())
|
||||
irc.reply(msg, text)
|
||||
|
||||
def hexip(self, irc, msg, args):
|
||||
"""<ip>
|
||||
|
||||
|
@ -51,6 +51,10 @@ class FunTest(ChannelPluginTestCase, PluginDocumentation):
|
||||
for i in range(100):
|
||||
self.assertNotError('jeffk the quick brown fox is ghetto')
|
||||
|
||||
def testSquish(self):
|
||||
self.assertResponse('squish foo bar baz', 'foobarbaz')
|
||||
self.assertResponse('squish "foo bar baz"', 'foobarbaz')
|
||||
|
||||
def testLithp(self):
|
||||
self.assertResponse('lithp jamessan', 'jamethan')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user