Fix announcement publishing with sendToNewMember=true

This commit is contained in:
Karlatemp 2021-07-15 22:26:09 +08:00
parent d5372f350d
commit d40b74b311
No known key found for this signature in database
GPG Key ID: 21FBDDF664FF06F8

View File

@ -203,7 +203,13 @@ internal object AnnouncementProtocol {
image: AnnouncementImage?,
): String {
return Mirai.Http.post<String> {
url("https://web.qun.qq.com/cgi-bin/announce/add_qun_notice")
url(
"https://web.qun.qq.com/cgi-bin/announce/add_qun_" + if (announcement.type == 20) {
"instruction"
} else {
"notice"
}
)
body = MultiPartFormDataContent(formData {
append("qid", groupId)
this.append("bkn", bkn)
@ -219,6 +225,7 @@ internal object AnnouncementProtocol {
announcement.settings.toJsonString(GroupAnnouncementSettings.serializer()),
)
append("format", "json")
// append("type", announcement.type.toString())
})
cookie("uin", "o$id")
cookie("p_uin", "o$id")