@@ -57,6 +57,12 @@ def __str__(self) -> str:
57
57
async def to_str (self ) -> str :
58
58
"""
59
59
get room invitation string format description with async way
60
+ Args:
61
+ self: RoomInvitation object
62
+ Examples:
63
+ >>> invitation_str = RoomInvitation.to_str()
64
+ Returns:
65
+ str: room invitation string format description
60
66
"""
61
67
log .info ('to_str()' )
62
68
payload = await self .puppet .room_invitation_payload (
@@ -76,8 +82,12 @@ async def to_str(self) -> str:
76
82
def load (cls , room_invitation_id : str ) -> RoomInvitation :
77
83
"""
78
84
load RoomInvitation object
79
- :param room_invitation_id:
80
- :return:
85
+ Args:
86
+ room_invitation_id: room invitation id
87
+ Examples:
88
+ >>> invitation = RoomInvitation.load(room_invitation_id)
89
+ Returns:
90
+ RoomInvitation: RoomInvitation object
81
91
"""
82
92
log .info ('load () <%s>' , room_invitation_id )
83
93
@@ -87,6 +97,12 @@ def load(cls, room_invitation_id: str) -> RoomInvitation:
87
97
async def accept (self ) -> None :
88
98
"""
89
99
accept the room invitation
100
+ Args:
101
+ self: RoomInvitation object
102
+ Examples:
103
+ >>> await invitation.accept()
104
+ Returns:
105
+ None
90
106
"""
91
107
log .info ('accept() <%s>' , self )
92
108
await self .puppet .room_invitation_accept (
@@ -108,6 +124,12 @@ async def accept(self) -> None:
108
124
async def inviter (self ) -> Contact :
109
125
"""
110
126
get the inviter of the invitation
127
+ Args:
128
+ self: RoomInvitation object
129
+ Examples:
130
+ >>> inviter = await invitation.inviter()
131
+ Returns:
132
+ Contact: inviter of the invitation
111
133
"""
112
134
log .info ('inviter() <%s>' , self )
113
135
payload = await self .puppet .room_invitation_payload (
@@ -118,6 +140,12 @@ async def inviter(self) -> Contact:
118
140
async def topic (self ) -> str :
119
141
"""
120
142
get the topic of the intivation
143
+ Args:
144
+ self: RoomInvitation object
145
+ Examples:
146
+ >>> topic = await invitation.topic()
147
+ Returns:
148
+ str: topic of the invitation
121
149
"""
122
150
log .info ('topic() <%s>' , self )
123
151
payload = await self .puppet .room_invitation_payload (
@@ -127,6 +155,12 @@ async def topic(self) -> str:
127
155
async def member_count (self ) -> int :
128
156
"""
129
157
get the number of the invitation members
158
+ Args:
159
+ self: RoomInvitation object
160
+ Examples:
161
+ >>> member_count = await invitation.member_count()
162
+ Returns:
163
+ int: number of the invitation members
130
164
"""
131
165
log .info ('member_count() <%s>' , self )
132
166
payload = await self .puppet .room_invitation_payload (
@@ -136,6 +170,12 @@ async def member_count(self) -> int:
136
170
async def member_list (self ) -> List [Contact ]:
137
171
"""
138
172
get the members of the room invitation
173
+ Args:
174
+ self: RoomInvitation object
175
+ Examples:
176
+ >>> member_list = await invitation.member_list()
177
+ Returns:
178
+ List[Contact]: members of the room invitation
139
179
"""
140
180
log .info ('member_list() <%s>' , self )
141
181
payload = await self .puppet .room_invitation_payload (
@@ -155,6 +195,12 @@ async def member_list(self) -> List[Contact]:
155
195
async def date (self ) -> datetime :
156
196
"""
157
197
get the date of the room invitation
198
+ Args:
199
+ self: RoomInvitation object
200
+ Examples:
201
+ >>> date = await invitation.date()
202
+ Returns:
203
+ datetime: date of the room invitation
158
204
"""
159
205
log .info ('date() <%s>' , self )
160
206
payload = await self .puppet .room_invitation_payload (
@@ -165,6 +211,12 @@ async def date(self) -> datetime:
165
211
async def age (self ) -> int :
166
212
"""
167
213
get the age of the invitation timespan
214
+ Args:
215
+ self: RoomInvitation object
216
+ Examples:
217
+ >>> age = await invitation.age()
218
+ Returns:
219
+ int: age of the invitation timespan
168
220
"""
169
221
log .info ('age() <%s>' , self )
170
222
payload = await self .puppet .room_invitation_payload (
@@ -179,6 +231,12 @@ async def from_json(cls,
179
231
) -> RoomInvitation :
180
232
"""
181
233
Load the room invitation info from disk
234
+ Args:
235
+ payload: room invitation payload
236
+ Examples:
237
+ >>> invitation = await RoomInvitation.from_json(payload)
238
+ Returns:
239
+ RoomInvitation: room invitation object
182
240
"""
183
241
if isinstance (payload , str ):
184
242
log .info ('from_json() <%s>' , payload )
@@ -201,6 +259,12 @@ async def from_json(cls,
201
259
async def to_json (self ) -> str :
202
260
"""
203
261
Get the room invitation info when listened on room-invite event
262
+ Args:
263
+ self: RoomInvitation object
264
+ Examples:
265
+ >>> json_str = await invitation.to_json()
266
+ Returns:
267
+ str: room invitation info
204
268
"""
205
269
log .info ('to_json() <%s>' , self )
206
270
payload = await self .puppet .room_invitation_payload (
0 commit comments