

def func(self):
    '\n        Create a new message and send it to channel, using\n        the already formatted input.\n        '
    caller = self.caller
    (channelkey, msg) = self.args
    if (not msg):
        caller.msg('Say what?')
        return
    channel = ChannelDB.objects.get_channel(channelkey)
    if (not channel):
        caller.msg(("Channel '%s' not found." % channelkey))
        return
    if (not channel.has_connection(caller)):
        string = "You are not connected to channel '%s'."
        caller.msg((string % channelkey))
        return
    if (not channel.access(caller, 'send')):
        string = "You are not permitted to send to channel '%s'."
        caller.msg((string % channelkey))
        return
    msg = ('[%s] %s: %s' % (channel.key, caller.name, msg))
    msgobj = create.create_message(caller, msg, channels=[channel])
    channel.msg(msgobj)

dataset/ETHPy150Open evennia/evennia/evennia/commands/default/syscommands.py SystemSendToChannel.func/original