ib3 package¶
Module contents¶
-
class
ib3.Bot(*args, **kwargs)[source]¶ Bases:
irc.bot.SingleServerIRCBotBasic IRC bot.
Simple subclass of
irc.bot.SingleServerIRCBotthat sets up lenient UTF-8 encoding handling for inbound messages. This is a nice base to start from when adding other IB3 mixins.
Submodules¶
ib3.auth module¶
-
class
ib3.auth.AbstractAuth(server_list, nickname, realname, ident_password, channels=None, username=None, **kwargs)[source]¶ Bases:
ib3.mixins.JoinChannelsBase class for authentication mixins.
-
__init__(server_list, nickname, realname, ident_password, channels=None, username=None, **kwargs)[source]¶ Parameters: - server_list – List of servers the bot will use.
- nickname – The bot’s nickname
- realname – The bot’s realname
- ident_password – The bot’s password
- channels – List of channels to join after authenticating
- username – IRC username (default: nickname)
-
-
class
ib3.auth.NickServ(*args, **kwargs)[source]¶ Bases:
ib3.auth.AbstractAuthAuthenticate with NickServ before joining channels.
-
__init__(*args, **kwargs)[source]¶ Parameters: - server_list – List of servers the bot will use.
- nickname – The bot’s nickname
- realname – The bot’s realname
- ident_password – The bot’s password
- channels – List of channels to join after authenticating
- username – IRC username (default: nickname)
-
_handle_privnotice(conn, event)[source]¶ Handle NOTICE sent directly to user.
Check for messages from NickServ requesting auth, warning of password failures, and acknowledging successful auth.
-
-
class
ib3.auth.SASL(*args, **kwargs)[source]¶ Bases:
ib3.auth.AbstractAuthAuthenticate using SASL before joining channels.
ib3.connection module¶
ib3.mixins module¶
-
class
ib3.mixins.DisconnectOnError(*args, **kwargs)[source]¶ Bases:
objectHandle ERROR message by logging and disconnecting.
-
class
ib3.mixins.PingServer(max_pings=2, ping_interval=300, *args, **kwargs)[source]¶ Bases:
objectAdd checks for connection liveness using PING commands.
ib3.nick module¶
-
class
ib3.nick.Ghost(server_list, nickname, realname, altnick=None, *args, **kwargs)[source]¶ Bases:
ib3.nick.NicknameInUseGHOST disconnects an old user session, or somebody attempting to use your nickname without authorization.
This mixin assumes that you are also using a mixin from
ib3.author another means to authenticate your IRC account.
-
class
ib3.nick.NicknameInUse(server_list, nickname, realname, altnick=None, *args, **kwargs)[source]¶ Bases:
objectHandle ERR_NICKNAMEINUSE messages by changing to an alternate nick.
-
__init__(server_list, nickname, realname, altnick=None, *args, **kwargs)[source]¶ Parameters: - server_list – List of servers the bot will use.
- nickname – The bot’s nickname
- realname – The bot’s realname
- altnick – Alternate nickname if primary nick is taken
-
_handle_nicknameinuse(conn, event)[source]¶ Handle ERR_NICKNAMEINUSE message.
If failed nick matches our desired nick, switch to secondary nick, and schedule an attempt to reclaim our primary nick.
If failed nick matches our secondary nick, die.
-
-
class
ib3.nick.Regain(server_list, nickname, realname, altnick=None, *args, **kwargs)[source]¶ Bases:
ib3.nick.NicknameInUseREGAIN disconnects an old user session, or somebody attempting to use your nickname without authorization, then changes your nickname to the given nickname. This may not work, disconnecting you, if the target client reconnects automatically.
This mixin assumes that you are also using a mixin from
ib3.author another means to authenticate your IRC account.