'Implement the command'

def func(self):

    caller = self.caller
    args = self.args
    if (not args):
        string = 'Usage:    '
        string += '\n@emit[/switches]    [<obj>,    <obj>,    ...    =]    <message>'
        string += '\n@remit                                            [<obj>,    <obj>,    ...    =]    <message>'
        string += '\n@pemit                                            [<obj>,    <obj>,    ...    =]    <message>'
        caller.msg(string)
        return
    rooms_only = ('rooms' in self.switches)
    players_only = ('players' in self.switches)
    send_to_contents = ('contents' in self.switches)
    if (self.cmdstring == '@remit'):
        rooms_only = True
        send_to_contents = True
    elif (self.cmdstring == '@pemit'):
        players_only = True
    if (not self.rhs):
        message = self.args
        objnames = [caller.location.key]
    else:
        message = self.rhs
        objnames = self.lhslist
    for objname in objnames:
        obj = caller.search(objname, global_search=True)
        if (not obj):
            return
        if (rooms_only and (obj.location is not None)):
            caller.msg(('%s    is    not    a    room.    Ignored.' % objname))
            continue
        if (players_only and (not obj.has_player)):
            caller.msg(('%s    has    no    active    player.    Ignored.' % objname))
            continue
        if obj.access(caller, 'tell'):
            obj.msg(message)
            if (send_to_contents and hasattr(obj, 'msg_contents')):
                obj.msg_contents(message)
                caller.msg(('Emitted    to    %s    and    contents:\n%s' % (objname, message)))
            else:
                caller.msg(('Emitted    to    %s:\n%s' % (objname, message)))
        else:
            caller.msg(('You    are    not    allowed    to    emit    to    %s.' % objname))
