mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-02 07:34:08 +01:00
Utilities: Add @concat command
This commit is contained in:
parent
45e6b7be7a
commit
75f9917f86
@ -67,6 +67,15 @@ class Utilities(callbacks.Plugin):
|
||||
irc.replySuccess(text)
|
||||
success = wrap(success, [additional('text')])
|
||||
|
||||
@internationalizeDocstring
|
||||
def concat(self, irc, msg, args, things):
|
||||
"""<arg> [<arg> ...]
|
||||
|
||||
Concatenates all arguments.
|
||||
"""
|
||||
irc.reply(''.join(things))
|
||||
concat = wrap(concat, [many('anything')])
|
||||
|
||||
@internationalizeDocstring
|
||||
def last(self, irc, msg, args):
|
||||
"""<text> [<text> ...]
|
||||
|
@ -39,6 +39,11 @@ class UtilitiesTestCase(PluginTestCase):
|
||||
self.assertNotError('success 1')
|
||||
self.assertError('success [re m/foo bar]')
|
||||
|
||||
def testConcat(self):
|
||||
self.assertResponse('concat foo bar', 'foobar')
|
||||
self.assertResponse('concat [echo foo] [echo bar]', 'foobar')
|
||||
self.assertResponse('concat "foo bar"', 'foo bar')
|
||||
|
||||
def testLast(self):
|
||||
self.assertResponse('utilities last foo bar baz', 'baz')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user