Set group profile image. If the group is already promoted (any message was sent to the group), all group members are informed by a special status message that is sent automatically by this function. :params img_path: path to image object :raises ValueError: i
(self, img_path)
| 426 | return lib.dc_array_get_cnt(dc_array) |
| 427 | |
| 428 | def set_profile_image(self, img_path): |
| 429 | """Set group profile image. |
| 430 | |
| 431 | If the group is already promoted (any message was sent to the group), |
| 432 | all group members are informed by a special status message that is sent |
| 433 | automatically by this function. |
| 434 | :params img_path: path to image object |
| 435 | :raises ValueError: if profile image could not be set |
| 436 | :returns: None |
| 437 | """ |
| 438 | assert os.path.exists(img_path), img_path |
| 439 | p = as_dc_charpointer(img_path) |
| 440 | res = lib.dc_set_chat_profile_image(self.account._dc_context, self.id, p) |
| 441 | if res != 1: |
| 442 | raise ValueError(f"Setting Profile Image {p!r} failed") |
| 443 | |
| 444 | def remove_profile_image(self): |
| 445 | """remove group profile image. |