from motobot import command, action, IRCLevel


@command('say', level=IRCLevel.master)
def say_command(bot, nick, channel, message, args):
    if len(args) < 3:
        return "You must specify both a channel and a message"
    else:
        channel = args[1]
        message = ' '.join(args[2:])
        if message.startswith('/me '):
            message = action(message[4:])
        bot.send('PRIVMSG {} :{}'.format(channel, message))

@@ -26,15 +26,23 @@
 nd, 
-a
+A
 ction,
+ Target,
  IRC
@@ -148,124 +148,45 @@
     
-if len(args) %3C 3:%0A        return %22You must specify both a channel and a message%22%0A    else:%0A        channel = 
+try:%0A        target = Target(
 args%5B1%5D
+)
 %0A   
@@ -191,22 +191,18 @@
        m
-essage
+sg
  = ' '.j
@@ -211,24 +211,25 @@
 n(args%5B2:%5D)%0A
+%0A
         if m
@@ -271,94 +271,164 @@
     
-message = action(message%5B4:%5D)%0A        bot.send('PRIVMSG %7B%7D :%7B%7D'.format(
+return msg, target, Action%0A        else:%0A            return msg, target%0A%0A    except IndexError:%0A        return %22You must specify both a 
 channel
-,
+ and a
  message
 ))%0A
@@ -428,7 +428,6 @@
 sage
-))
+%22
 %0A

update say to work with modifiers