wechaty / puppet-padlocal

Puppet PadLocal is a Pad Protocol for WeChat
https://wechaty.js.org/docs/puppet-providers/padlocal
Apache License 2.0
614 stars 86 forks source link

. #259

Closed Yang474985795 closed 11 months ago

Yang474985795 commented 12 months ago

.

bestK commented 11 months ago

🖕 直接鄙视楼上两个

 xmlMsg.content = `<?xml version="1.0"?>
      <msg>
              <appmsg appid="wx5aa333606550dfd5" sdkver="0">
                      <title>嘉宾</title>
                      <des>张远</des>
                      <action>view</action>
                      <type>3</type>
                      <showtype>0</showtype>
                      <content />
                      <url>https://i.y.qq.com/v8/playsong.html?hosteuin=oK6kowEAoK4z7eSqoi6F7iCPon**&amp;sharefrom=&amp;from_id=0&amp;from_idtype=0&amp;from_name=&amp;songid=281506863&amp;songmid=&amp;type=0&amp;platform=(10rpl)&amp;appsongtype=(11rpl)&amp;_wv=1&amp;source=qq&amp;appshare=iphone&amp;media_mid=000CsplS4eA2jd&amp;ADTAG=wxfshare</url>
                      <dataurl>http://c6.y.qq.com/rsc/fcgi-bin/fcg_pyq_play.fcg?songid=0&amp;songmid=001i36ji0C8Cov&amp;songtype=1&amp;fromtag=46&amp;uin=1152921504793187640&amp;code=c135e</dataurl>
                      <lowurl />
                      <lowdataurl />
                      <recorditem>(null)</recorditem>
                      <thumburl />
                      <messageaction />
                      <laninfo />
                      <md5>aa6e1c793929a0edfdda69aed5906c58</md5>
                      <extinfo />
                      <sourceusername />
                      <sourcedisplayname />
                      <commenturl />
                      <appattach>
                              <totallen>0</totallen>
                              <attachid />
                              <emoticonmd5 />
                              <fileext>jpg</fileext>
                              <filekey>9bb604b62db7008a6c269937ef1a2623</filekey>
                              <cdnthumburl>3057020100044b30490201000204fbbf095802032f5aa90204d1996971020464d335da042437623063666463352d393037392d343163392d383831372d3064343633353238626230390204011808030201000405004c537500</cdnthumburl>
                              <aeskey>58ed62307de144f5bd0e9c6378fa94bb</aeskey>
                              <cdnthumbaeskey>58ed62307de144f5bd0e9c6378fa94bb</cdnthumbaeskey>
                              <encryver>1</encryver>
                              <cdnthumblength>6571</cdnthumblength>
                              <cdnthumbheight>100</cdnthumbheight>
                              <cdnthumbwidth>100</cdnthumbwidth>
                      </appattach>
                      <weappinfo>
                              <pagepath />
                              <username />
                              <appid />
                              <appservicetype>0</appservicetype>
                      </weappinfo>
                      <websearch />
              </appmsg>
              <fromusername>xxxx</fromusername>
              <scene>0</scene>
              <appinfo>
                      <version>53</version>
                      <appname>QQ音乐</appname>
              </appinfo>
              <commenturl></commenturl>
      </msg>`

      // 利用消息转发 debug 可知此消息类型为 49,直接构造 xml 调用 forwardMessage 接口即可
      await bot.puppet.messageForward(talker.id, message.id)
      const response = await bot.puppet._client.api.forwardMessage(new Date().getTime(), talker.id, xmlMsg.content, 49, talker.id);

image

bestK commented 11 months ago

image 想不明白这种操作,是怕别人知道了?

MEK-THEB commented 6 months ago

🖕 直接鄙视楼上两个

 xmlMsg.content = `<?xml version="1.0"?>
      <msg>
              <appmsg appid="wx5aa333606550dfd5" sdkver="0">
                      <title>嘉宾</title>
                      <des>张远</des>
                      <action>view</action>
                      <type>3</type>
                      <showtype>0</showtype>
                      <content />
                      <url>https://i.y.qq.com/v8/playsong.html?hosteuin=oK6kowEAoK4z7eSqoi6F7iCPon**&amp;sharefrom=&amp;from_id=0&amp;from_idtype=0&amp;from_name=&amp;songid=281506863&amp;songmid=&amp;type=0&amp;platform=(10rpl)&amp;appsongtype=(11rpl)&amp;_wv=1&amp;source=qq&amp;appshare=iphone&amp;media_mid=000CsplS4eA2jd&amp;ADTAG=wxfshare</url>
                      <dataurl>http://c6.y.qq.com/rsc/fcgi-bin/fcg_pyq_play.fcg?songid=0&amp;songmid=001i36ji0C8Cov&amp;songtype=1&amp;fromtag=46&amp;uin=1152921504793187640&amp;code=c135e</dataurl>
                      <lowurl />
                      <lowdataurl />
                      <recorditem>(null)</recorditem>
                      <thumburl />
                      <messageaction />
                      <laninfo />
                      <md5>aa6e1c793929a0edfdda69aed5906c58</md5>
                      <extinfo />
                      <sourceusername />
                      <sourcedisplayname />
                      <commenturl />
                      <appattach>
                              <totallen>0</totallen>
                              <attachid />
                              <emoticonmd5 />
                              <fileext>jpg</fileext>
                              <filekey>9bb604b62db7008a6c269937ef1a2623</filekey>
                              <cdnthumburl>3057020100044b30490201000204fbbf095802032f5aa90204d1996971020464d335da042437623063666463352d393037392d343163392d383831372d3064343633353238626230390204011808030201000405004c537500</cdnthumburl>
                              <aeskey>58ed62307de144f5bd0e9c6378fa94bb</aeskey>
                              <cdnthumbaeskey>58ed62307de144f5bd0e9c6378fa94bb</cdnthumbaeskey>
                              <encryver>1</encryver>
                              <cdnthumblength>6571</cdnthumblength>
                              <cdnthumbheight>100</cdnthumbheight>
                              <cdnthumbwidth>100</cdnthumbwidth>
                      </appattach>
                      <weappinfo>
                              <pagepath />
                              <username />
                              <appid />
                              <appservicetype>0</appservicetype>
                      </weappinfo>
                      <websearch />
              </appmsg>
              <fromusername>xxxx</fromusername>
              <scene>0</scene>
              <appinfo>
                      <version>53</version>
                      <appname>QQ音乐</appname>
              </appinfo>
              <commenturl></commenturl>
      </msg>`

      // 利用消息转发 debug 可知此消息类型为 49,直接构造 xml 调用 forwardMessage 接口即可
      await bot.puppet.messageForward(talker.id, message.id)
      const response = await bot.puppet._client.api.forwardMessage(new Date().getTime(), talker.id, xmlMsg.content, 49, talker.id);

image

你好 请问你现在还能发送音乐类型的消息嘛?我参考层主你的方法 但是报错: padlocal grpc request failed: 1, error: Error: 2 UNKNOWN: internal error