Exemplo n.º 1
0
    mapping = IRCChannelMapping.objects.filter(channel__name=channel)
    if mapping:
        mapping = mapping[0]
        outstring = "Replacing %s. New " % mapping
    else:
        mapping = IRCChannelMapping()
    
    mapping.irc_server_name = settings.IRC_NETWORK
    mapping.irc_channel_name = irc_channel   
    mapping.channel = chanobj
    mapping.save()
    outstring += "Mapping set: %s." % mapping    
    source_object.emit_to(outstring)

GLOBAL_CMD_TABLE.add_command("@irc2chan",cmd_IRC2chan,
                             priv_tuple=("irc.admin_irc_channels",),
                             help_category="Comms")
    
def cmd_IRCjoin(command):
    """
    @ircjoin - join a new irc channel

    Usage:
      @ircjoin <#IRCchannel>

    Attempts to connect a bot to a new IRC channel (don't forget that
    IRC channels begin with a #).
    The bot uses the connection details defined in the main settings. 

    Observe that channels added using this command does not survive a reboot. 
    """
Exemplo n.º 2
0
    imcwhois

    Usage:
      imcwhois
      
    IMC2 command. Shows a player's inventory.
    """
    source_object = command.source_object
    if not command.command_argument:    
        source_object.emit_to("Get what?")
        return
    else:
        source_object.emit_to("Sending IMC whois request. If you receive no response, no matches were found.")
        packet = IMC2PacketWhois(source_object, command.command_argument)
        imc2_conn.IMC2_PROTOCOL_INSTANCE.send_packet(packet)
GLOBAL_CMD_TABLE.add_command("imcwhois", cmd_imcwhois, help_category="Comms")

def cmd_imcansi(command):
    """
    imcansi
    
    Usage:
      imcansi <string>
      
    Test IMC ANSI conversion.
    """
    source_object = command.source_object
    if not command.command_argument:    
        source_object.emit_to("You must provide a string to convert.")
        return
    else: