用代码表达言语的魅力,用代码书写山河的壮丽。
——— 一言「一言开发者中心」
import requests
import time
def receive_messages(api_url, token):
last_id = 0
while True:
try:
response = requests.get(f"{api_url}/messages?since={last_id}")
messages = response.json().get("messages", [])
for msg in messages:
print(f"收到消息: {msg['sender']}: {msg['content']}")
last_id = max(last_id, msg['id'])
time.sleep(2)
API_URL = "http://voce.bugcode.cc/api"
receive_messages(API_URL, TOKEN)我常常在想方设法编写这段内容,每次看着别人的简介,总是好奇真的有人想的出来在这里写什么嘛,,
🖨️ 站点详细
| 介绍 | 链接 |
|---|---|
| 主要站点,集成导航功能 | http://bugcode.cc |
| 镜像站点,集成导航功能 | http://bugji.github.io |
| 加入我的QQ群 | http://qun.qq.com/invite?group_id=835382474 |
| 聊天服务器 | http://voce.bugcode.cc |


