Skip to content
fro_ozen edited this page Jul 25, 2015 · 3 revisions

All of the following are located in the modules pybot.users

The User_data class

A User_data object represents all the known data about the channels and users of an Irc_server object.

Attributes and methods
class User_data(object):
    # Methods
    def get_user(self, nick) # Return the User object corresponding to nick
    def get_channel(self, channel) # Return the Channel object corresponding to channel
Initialisation

A User_data can be created by passing it the Irc_server object it corresponds to:

user_data = User_data(server)

The User class

A User represents an IRC user.

Attributes and methods
class User(object):
    # Attributes
    self.nick # The users nickname
    self.channels # A list of the users channels as strings
    self.host # The users host
Initialisation

A User can be create by passing it its nickname:

user = User("cool_guy_99")

The Channel class

A Channel represents an IRC channel.

Attributes and methods
class Channel(object):
    self.name # The channels name
    self.users # List of User objects currently present in channel
    self.ops # List of ops currently present in channel
Initialisation

A Channel can be created by passing it its name:

channel = Channel("#python")