pyrc classes
AsyncDict
Bases: dict
Dictionary supporting asynchronous iteration to avoid blocking running event loops
Source code in pyrc/classes.py
12 13 14 15 16 17 18 19 20 |
|
Context
Event context class for event callbacks
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raw |
str
|
The raw command string, if the callback needs to parse it further |
required |
author |
Union[IRCUser, None]
|
The IRCUser object of the person who caused this event |
None
|
channel |
Union[IRCChannel, None]
|
The channel that this command targets, if any |
None
|
message |
Union[str, None]
|
The trailer of the command (May be an actual message, or a parameter that includes spaces) |
None
|
ctcp |
Union[str, None]
|
The CTCP query string found in the message, if any. Will only be present if the command is a PRIVMSG, per spec |
None
|
event |
Union[str, None]
|
The event that instantiated this Context |
None
|
Attributes:
Name | Type | Description |
---|---|---|
raw |
The raw string that triggered this event |
|
author |
The IRCUser that triggered this event, if any |
|
channel |
The IRCChannel this event was triggered in, if any |
|
message |
The trailer for the event (is not always a message), if any |
|
ctcp |
The CTCP data in this event, if any |
Source code in pyrc/classes.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
IRCChannel
Bases: IRCObjectSendable
Class denoting an IRC server channel
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the channel. Additional data will be added to the channel when it becomes available |
required |
client |
The IRCClient that instantiated this IRCChannel |
required |
Attributes:
Name | Type | Description |
---|---|---|
name |
The name of this channel |
|
chmodes |
The channel modes for this channel, may be None if lazyloading (default) |
|
users |
A set of IRCUser objects in this channel |
Source code in pyrc/classes.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
sync()
Sync the cached (temporary) userlist to the permanent userlist. Will do nothing if the channel is not marked as actively caching
Source code in pyrc/classes.py
109 110 111 112 113 114 115 116 117 118 |
|
IRCObjectSendable
Object class for IRC objects, implements a .send_to() method for sending messages that target this object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client |
IRCClient object that this object is bound to |
required | |
sendable |
str
|
A string that denotes the PRIVMSG/NOTICE target |
required |
Source code in pyrc/classes.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
send_to(message)
async
Sends a message to the target of this IRC object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str
|
The message to send |
required |
Source code in pyrc/classes.py
34 35 36 37 38 39 |
|
IRCUser
Bases: IRCObjectSendable
Object denoting an IRC user
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user_string |
str
|
The string that identifies the user (either nick or nick!user@host) |
required |
chmapping |
Dict[str, str]
|
The channel mode mapping for the server this user originates from |
required |
client |
The IRCClient that instantiated this IRCUser |
required |
Attributes:
Name | Type | Description |
---|---|---|
raw |
The raw userstring for this User |
|
nick |
The nickname of this User |
|
host |
The host/vhost of this User, may be None if this user is lazily loaded (default) |
|
user |
The username of this User, may be None if this user is lazily loaded (default) |
Source code in pyrc/classes.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|