Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:save message #2

Merged
merged 9 commits into from
Dec 11, 2023
Merged

feat:save message #2

merged 9 commits into from
Dec 11, 2023

Conversation

niracler
Copy link
Owner

@niracler niracler commented Dec 11, 2023

结果

过程 & 坑

将 Telegram 频道的数据 DB 化了,之后的历史记录自动存档入库。👋

(绝对不是因为在玩星穹而周末什么都没做。喜欢「坏女人」卡芙卡。 卡芙卡=玛奇玛,艾利欧=艾主席 #暴论)
#星穹铁道 #telegram


最初目标是转发 Telegram 消息到 X。而机器人 API 不支持通过 media_group_id 拿历史消息,这需要机器人将每次收到的信息都存起来。好多细节,也受到了 X API 的限制


关于 X 的限制

  1. 最多发 4 张图,而且有 140 字的限制, 需要分多次发
  2. 一天发 tweet 上限是 50 次(测试的时候超出了)
  3. 避免分太多段,会触发 cf worker 超过 10ms 截断, 临界值还没测出来

其他碎碎念

  1. 没用 SDK,硬是凑了 TelegramUpdate 的 Type
  2. 在 Copilot 的加持下, 烂代码数量指数增长
  3. 之后再用个人帐号 API 导出历史信息
  4. 四年没用 SQL ,用起来磕磕绊绊

下一步就是整理代码了

link

@niracler niracler merged commit 4892851 into main Dec 11, 2023
@niracler niracler deleted the feat/save-message branch December 11, 2023 15:37
@niracler niracler self-assigned this Feb 27, 2024
@niracler niracler added the documentation Improvements or additions to documentation label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant