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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
use std::collections::HashMap;
use crate::pb;
pub mod builder;
pub mod decoder;
#[derive(Default, Debug)]
pub struct GroupAtAllRemainInfo {
pub can_at_all: bool,
pub remain_at_all_count_for_group: u32,
pub remain_at_all_count_for_uin: u32,
}
pub struct OcrResponse {
pub texts: Vec<pb::oidb::TextDetection>,
pub language: String,
}
#[derive(Default, Debug)]
pub struct ProfileDetailUpdate(pub HashMap<u16, Vec<u8>>);
impl ProfileDetailUpdate {
pub fn new() -> Self {
Self::default()
}
pub fn name(&mut self, value: String) {
self.0.insert(20002, value.into_bytes());
}
pub fn email(&mut self, value: String) {
self.0.insert(20011, value.into_bytes());
}
pub fn personal_note(&mut self, value: String) {
self.0.insert(20019, value.into_bytes());
}
pub fn company(&mut self, value: String) {
self.0.insert(24008, value.into_bytes());
}
pub fn college(&mut self, value: String) {
self.0.insert(20021, value.into_bytes());
}
}
pub enum ShareTarget {
Friend(i64),
Group(i64),
Guild { guild_id: u64, channel_id: u64 },
}
impl ShareTarget {
pub fn send_type(&self) -> u32 {
match self {
ShareTarget::Friend { .. } => 0,
ShareTarget::Group { .. } => 1,
ShareTarget::Guild { .. } => 3,
}
}
}
pub struct MusicShare {
pub title: String,
pub brief: String,
pub summary: String,
pub url: String,
pub picture_url: String,
pub music_url: String,
}
pub struct MusicVersion {
pub app_id: u64,
pub app_type: u32,
pub platform: u32,
pub sdk_version: &'static str,
pub package_name: &'static str,
pub signature: &'static str,
}
impl MusicVersion {
pub const QQ: MusicVersion = MusicVersion {
app_id: 100497308,
app_type: 1,
platform: 1,
sdk_version: "0.0.0",
package_name: "com.tencent.qqmusic",
signature: "cbd27cd7c861227d013a25b2d10f0799",
};
pub const NETEASE: MusicVersion = MusicVersion {
app_id: 100495085,
app_type: 1,
platform: 1,
sdk_version: "0.0.0",
package_name: "com.netease.cloudmusic",
signature: "da6b069da1e2982db3e386233f68d76d",
};
pub const MIGU: MusicVersion = MusicVersion {
app_id: 1101053067,
app_type: 1,
platform: 1,
sdk_version: "0.0.0",
package_name: "cmccwm.mobilemusic",
signature: "6cdc72a439cef99a3418d2a78aa28c73",
};
pub const KUGOU: MusicVersion = MusicVersion {
app_id: 205141,
app_type: 1,
platform: 1,
sdk_version: "0.0.0",
package_name: "com.kugou.android",
signature: "fe4a24d80fcf253a00676a808f62c2c6",
};
pub const KUWO: MusicVersion = MusicVersion {
app_id: 100243533,
app_type: 1,
platform: 1,
sdk_version: "0.0.0",
package_name: "cn.kuwo.player",
signature: "bf9ff4ffb4c558a34ee3fd52c223ebf5",
};
}
pub struct LinkShare {
pub title: String,
pub summary: Option<String>,
pub brief: Option<String>,
pub picture_url: Option<String>,
pub url: String,
}