1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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
88
89
90
91
92
93
94
95
96
97
98
use std::sync::Arc;
use pyo3::prelude::*;
use ricq::structs::FriendGroupInfo;
use super::ClientImpl;
#[pyclass]
#[derive(Clone)]
pub struct FriendGroup {
#[allow(unused)] pub(super) client: Arc<ClientImpl>,
pub(super) info: FriendGroupInfo,
}
#[pymethods]
impl FriendGroup {
#[getter]
pub fn id(&self) -> u8 {
self.info.group_id
}
#[getter]
pub fn name(&self) -> &str {
&self.info.group_name
}
#[getter]
pub fn friend_count(&self) -> i32 {
self.info.friend_count
}
#[getter]
pub fn online_count(&self) -> i32 {
self.info.online_friend_count
}
#[getter]
pub fn seq_id(&self) -> u8 {
self.info.seq_id
}
fn __repr__(&self) -> String {
format!(
"FriendGroupInfo(id={:?}, name={:?}, friend_count={:?}, online_count={:?}, seq_id={:?})",
self.id(),
self.name(),
self.friend_count(),
self.online_count(),
self.seq_id()
)
}
}