Documentation for Aioyoyo¶
Base Clients¶
-
class
aioyoyo.client.
IRCClient
(loop=None, address=None, port=None, protocol=<class 'aioyoyo.protocol.ClientProtocol'>)[source]¶ -
-
connection_lost
(exc)[source]¶ Called when the connection is dropped, by default prints the exception if there is one. Forwarded by protocol.connection_lost
-
connection_made
()[source]¶ Called on a successful connection, by default forwarded by protocol.connection_made
-
data_received
(data)[source]¶ Called when data is received by the connection, by default forwarded by protocol.data_received, passes bytes not str
-
send
(*args)[source]¶ Send a message to the connected server. all arguments are joined with a space for convenience, for example the following are identical
>>> cli.send("JOIN %s" % some_room) >>> cli.send("JOIN", some_room)
In python 3, all args must be of type str or bytes, BUT if they are str they will be converted to bytes with the encoding specified by the ‘encoding’ keyword argument (default ‘utf8’).
-
Command Handlers¶
-
class
aioyoyo.cmdhandler.
BotCommandHandler
(client, command_handler)[source]¶ Complete command handler for bots
-
class
aioyoyo.cmdhandler.
CommandHandler
(client)[source]¶ The most basic CommandHandler
-
get
(in_command_parts)[source]¶ Finds a command commands may be dotted. each command part is checked that it does not start with and underscore and does not have an attribute “protected”. if either of these is true, ProtectedCommandError is raised. its possible to pass both “command.sub.func” and [“command”, “sub”, “func”].
-
-
class
aioyoyo.cmdhandler.
DefaultBotCommandHandler
(client)[source]¶ Default command handler for bots. Methods/Attributes are made available as commands
Default Protocol¶
Additional Helper Functions¶
-
class
aioyoyo.helpers.
HelperClient
(loop=None, address=None, port=None, protocol=<class 'aioyoyo.protocol.ClientProtocol'>)[source]¶ Contains helper functions for common IRC commands, you may either inherit from HelperClient (which inherits IRCClient,) or you may just call the methods indirectly with HelperClient.method(client, *args), for example:
MyClient = IRCClient() HelperClient.msg(MyClient, ‘username’, ‘hi!’)
-
ctcp
(cli, handle, cmd, msg='')[source]¶ Send CTCP command using PRIVMSG where handle is the user, cmd is the command and the optional msg
-
ctcp_reply
(cli, handle, cmd, msg='')[source]¶ Forewards ctcp_reply command to notice function with added CTCP formatting
-
identify
(cli, passwd, authuser='NickServ')[source]¶ Send IDENTIFY command with passwd, default authuser is NickServ
-
Defined Exceptions¶
IRC Events¶
Num: Command Num: Command 001: welcome 349: endofexceptlist 002: yourhost 351: version 003: created 352: whoreply 004: myinfo 353: namreply 005: featurelist 361: killdone 010: toomanypeeps 362: closing 200: tracelink 363: closeend 201: traceconnecting 364: links 202: tracehandshake 365: endoflinks 203: traceunknown 366: endofnames 204: traceoperator 367: banlist 205: traceuser 368: endofbanlist 206: traceserver 369: endofwhowas 207: traceservice 371: info 208: tracenewtype 372: motd 209: traceclass 373: infostart 210: tracereconnect 374: endofinfo 211: statslinkinfo 375: motdstart 212: statscommands 376: endofmotd 213: statscline 377: motd2 214: statsnline 381: youreoper 215: statsiline 382: rehashing 216: statskline 384: myportis 217: statsqline 391: time 218: statsyline 392: usersstart 219: endofstats 393: users 221: umodeis 394: endofusers 231: serviceinfo 395: nousers 232: endofservices 401: nosuchnick 233: service 402: nosuchserver 234: servlist 403: nosuchchannel 235: servlistend 404: cannotsendtochan 241: statslline 405: toomanychannels 242: statsuptime 406: wasnosuchnick 243: statsoline 407: toomanytargets 244: statshline 409: noorigin 250: luserconns 411: norecipient 251: luserclient 412: notexttosend 252: luserop 413: notoplevel 253: luserunknown 414: wildtoplevel 254: luserchannels 421: unknowncommand 255: luserme 422: nomotd 256: adminme 423: noadmininfo 257: adminloc1 424: fileerror 258: adminloc2 431: nonicknamegiven 259: adminemail 432: erroneusnickname 261: tracelog 433: nicknameinuse 262: endoftrace 436: nickcollision 263: tryagain 437: unavailresource 265: n_local 441: usernotinchannel 266: n_global 442: notonchannel 300: none 443: useronchannel 301: away 444: nologin 302: userhost 445: summondisabled 303: ison 446: usersdisabled 305: unaway 451: notregistered 306: nowaway 461: needmoreparams 311: whoisuser 462: alreadyregistered 312: whoisserver 463: nopermforhost 313: whoisoperator 464: passwdmismatch 314: whowasuser 465: yourebannedcreep 315: endofwho 466: youwillbebanned 316: whoischanop 467: keyset 317: whoisidle 471: channelisfull 318: endofwhois 472: unknownmode 319: whoischannels 473: inviteonlychan 321: liststart 474: bannedfromchan 322: list 475: badchannelkey 323: listend 476: badchanmask 324: channelmodeis 477: nochanmodes 329: channelcreate 478: banlistfull 331: notopic 481: noprivileges 332: currenttopic 482: chanoprivsneeded 333: topicinfo 483: cantkillserver 341: inviting 484: restricted 342: summoning 485: uniqopprivsneeded 346: invitelist 491: nooperhost 347: endofinvitelist 492: noservicehost 348: exceptlist 501: umodeunknownflag _ error _ dcc_connect _ join _ dcc_disconnect _ kick _ dccmsg _ mode _ disconnect _ part _ ctcp _ ping _ ctcpreply