on_room_join when there are new contacts to the room Args: room (Room): the room instance invitees (List[Contact]): the new contacts to the room inviter (Contact): the inviter who share qrcode or manual invite someone date (dat
(self, room: Room, invitees: List[Contact],
inviter: Contact, date: datetime)
| 211 | break |
| 212 | |
| 213 | async def on_room_join(self, room: Room, invitees: List[Contact], |
| 214 | inviter: Contact, date: datetime) -> None: |
| 215 | """on_room_join when there are new contacts to the room |
| 216 | |
| 217 | Args: |
| 218 | room (Room): the room instance |
| 219 | invitees (List[Contact]): the new contacts to the room |
| 220 | inviter (Contact): the inviter who share qrcode or manual invite someone |
| 221 | date (datetime): the datetime to join the room |
| 222 | """ |
| 223 | # 1. say something to welcome the new arrivals |
| 224 | names: List[str] = [] |
| 225 | for invitee in invitees: |
| 226 | await invitee.ready() |
| 227 | names.append(invitee.name) |
| 228 | |
| 229 | await room.say(f'welcome {",".join(names)} to the wechaty group !') |
| 230 | |
| 231 | |
| 232 | async def main() -> None: |