||RDQL-speaking IRC Bot|
||Methods defined here:|
- __init__(self, channels)
- Load channels from file, load commands from file, start connecting.
- addns(self, m, origin, args, text)
- Add a namespace to the common_namespaces set
- bye(self, origin, args, text)
- good bye
- catchall(self, m, origin, args, text)
- # A catchall, designed to catch anything starting with ^
- command_list(self, m, origin, args, text)
- List available commands, or, if asked for information on a specific command, return the RDQL query behind it.
- connect(self, host, port)
- forget_query(self, m, origin, args, text)
- Forget a stored query.
- help(self, m, origin, args, text)
- Help function for in-channel help with commands.
- info(self, m, origin, args, text)
- General information function.
- join_channel(self, m, origin, args, text)
- What to do when told to ^join a channel.
- listns(self, m, origin, args, text)
- List namespaces available to the bot from the common_namespaces function, sorted alphabetically
- Load command dictionary from the file commandlist.crs.
- new_query(self, m, origin, args, text)
- Add a new query to the command database. Useful for
common queries like mailbox, aim name, etc.
- ns(self, m, origin, args, text)
- Return the stored URL for a namespace. Useful for creating queries or documents.
- on_invite(self, m, origin, args, text)
- What to do when invited to a cahnnel.
- part_channel(self, m, origin, args, text)
- Response to a ^part command.
- prenamespaced_query(self, m, origin, args, text)
- Uses common namespaces to create a query so that you don't have to worry about bindings.
- put(self, m, origin, args, text)
- Put/Add is the way to add statements to the Model/Graph. It
uses URL lib to fetch the URL, and then dumps it.
- queries(self, commandname, commandparams, m, origin, args, text)
- Run stored queries.
- query(self, m, origin, args, text)
- Run queries against current RDF store. Queries are in RDQL.
- reload_commands(self, m, origin, args, text)
- Reloads the stored command dictionary. Only useful if you have two different sources modifing the dictionary for some reason.
- reply_to(self, origin, args)
- Built in IRC reply to to determine whether we reply to user or channel.
- run_command(self, m, origin, args, text)
- Runs commands stored via newquery.
- Saves the current command dictionary to a file.
- spam(self, m, origin, args, text)
- spam is not good
- tell(self, origin, args, msg)
- Built in tell function so we don't have to always use reply_to in later functions.
||Implement part of the IRC protocol on top of async_chat|
- Method resolution order:
Methods defined here:
- Set up nickname, channels, other information
- bind(self, callback, command, textPat=None, doc=None)
- callback is the routine to bind; it's called ala
callback(matchObj or None, origin, args, text)
command is one of the commands above, e.g. PRIVMSG
textpat is None or a regex object or string to compile to one
doc should be a list of strings; each will go on its own line
- collect_incoming_data(self, bytes)
- append bytes to buffer
- called by asyncore when terminator found in stream
- callback on connect
- makeConn(self, host, port)
- connect to host, port
- notice(self, dest, text)
- send a NOTICE to dest, a channel or user
- process_msg(self, args, text, origin)
- process newly received message
- startChannels(self, channels)
- connect to channels
- tell(self, dest, text)
- send a PRIVMSG to dest, a channel or user
- todo(self, args, *text)
- queue command
Methods inherited from asynchat.async_chat:
- automatically close this channel once the outgoing queue is empty
- push(self, data)
- push_with_producer(self, producer)
- predicate for inclusion in the readable for select()
- # refill the outgoing buffer by calling the more() method
# of the first producer in the queue
- set_terminator(self, term)
- Set the input delimiter. Can be a fixed string of any length, an integer, or None
- predicate for inclusion in the writable for select()
Data and other attributes inherited from asynchat.async_chat:
- ac_in_buffer_size = 4096
- ac_out_buffer_size = 4096
Methods inherited from asyncore.dispatcher:
- __getattr__(self, attr)
- # cheap inheritance, used to pass all other attribute
# references to the underlying socket object.
- add_channel(self, map=None)
- connect(self, address)
- create_socket(self, family, type)
- del_channel(self, map=None)
- listen(self, num)
- log(self, message)
- log_info(self, message, type='info')
- recv(self, buffer_size)
- send(self, data)
- set_socket(self, sock, map=None)
Data and other attributes inherited from asyncore.dispatcher:
- accepting = 0
- addr = None
- closing = 0
- connected = 0
- debug = 0