Commit 1f8bac0

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-01-23 03:37:31
docs: update bridge docs
1 parent 2a7ef6a
Changed files (2)
src
bridge
preview
src/bridge/README.md
@@ -16,11 +16,12 @@ mid: message_id
 3. Then we construct a special message (Named MSG-B) which can trigger the function of the third-party bot (bridgebot).
    We log the chat_id (MSG-A's cid) and message_id (MSG-A's mid) to #ID tag in the MSG-B, format: #ID=(MSG-A's cid, MSG-A's mid)
    And log the MSG-UPDATE tag in this format: #PROGRESS=(MSG-UPDATE's cid, MSG-UPDATE's mid) to MSG-B
+   More info can also be logged in MSG-B, like #URL, ...
 
 4. Send MSG-B to bridgebot to finish the task.
 
-5. After the task is finished, the bridgebot will reply to MSG-B with a new message containing the task results, named MSG-RES.
-So, we can parse the reply message of MSG-RES (i.e. MSG-B) to get the #ID tag and MSG-UPDATE tag, and then forward MSG-RES to MSG-A.
+5. After the task is finished, the bridgebot will send us a new message containing the task results, named MSG-RES.
+So, we can retrieve the last message sent from us (MSG-B) to get the #ID tag and MSG-UPDATE tag, and then forward MSG-RES to MSG-A.
 
 6. Finally, we delete MSG-UPDATE.
 
@@ -33,14 +34,14 @@ First, we reply to MSG-A with a progress updating message. (MSG-UPDATE)
 Then we construct a special message (MSG-B) which can trigger the function of @ParsehubBot:
 
 ```txt
+#URL=( https://v.douyin.com/helloworld )
 #ID=(-1001234455, 2385)
 #PROGRESS=(-1001234455, 2386)
-https://v.douyin.com/helloworld
 ```
 
 Send MSG-B to @ParsehubBot to finish the task.
 
-After the task is finished, @ParsehubBot will reply to MSG-B with a new message containing the video, named MSG-RES
-We parse the reply message of MSG-RES (i.e. MSG-B) to get cid= -1001234455, mid= 2385, and then forward MSG-RES to MSG-A.
+After the task is finished, @ParsehubBot will send us the douyin video, named MSG-RES
+We retrieve the chat history of @ParsehubBot to get last message sent from us (MSG-B) and parse it to get  cid= -1001234455, mid= 2385, and then forward MSG-RES to MSG-A.
 
 Finally, we delete MSG-UPDATE (cid= -1001234455, mid= 2386).
src/preview/ytdlp.py
@@ -157,9 +157,9 @@ async def preview_ytdlp(
     if true(kwargs.get("no_author")):
         pass
     elif author and author_url:
-        texts += f"\n{platform_emoji}[{author}]({author_url})"
+        texts += f"{platform_emoji}[{author}]({author_url})"
     elif author:
-        texts += f"\n{platform_emoji}{author}"
+        texts += f"{platform_emoji}{author}"
 
     # date
     create_time = ""