lamgc / scalabot Goto Github PK
View Code? Open in Web Editor NEWExtensible robot server based on rubenlagus/TelegramBots (Using Java or kotlin)
License: MIT License
Extensible robot server based on rubenlagus/TelegramBots (Using Java or kotlin)
License: MIT License
由于 JSON 格式对普通用户不太友好(根据目前得到的用户反馈),因此计划支持 TOML 配置文件格式,以提高易用性。
ScalaBot
这个名字有太多项目使用了,需要改一个名字。
原本这个名字是 Scalable 跟 Telegram 结合而成的,但搜了一下发现一堆这个名字的项目。
所以得想个新的名字。
使用常量不利于对组件进行测试,有必要改一下常量对象的获取形式了!
需要调整的常量有:
经排查,使用 Const 的有:
使用 AppPaths 的有:
计划的改动:
计划添加一个 Http 服务端,用于检查 ScalaBot 的运行状态,
例如接口为 http://localhost:8800/healthy
,接口的返回有以下类型:
查看 Telegram Bots API 文档时,发现有个可以设置命令范围的功能:BotCommandScope
计划利用这个功能,增强命令列表的更新功能,让用户看到可以使用的命令,看不到不能使用的命令。
打算加个从 Maven 仓库(并不局限于 Maven **仓库)加载扩展的 ExtensionPackageFinder,但现有的扩展包发现机制会将从 Maven 仓库发现的扩展包视为冲突项,所以计划添加一个发现器优先级与选项,用于控制扩展包使用优先级与可选与否的操作。
所需细节:
ScalaBot 在配置上有一些信息可以向扩展提供,最主要的就是代理配置。
或许应该使用一种方法,将有关的配置提供给扩展,减少用户的配置难度。
计划在启动时,调用一下 GetMe
接口,检查机器人账号是否正常。
目前 Bot 的 MapDB 文件名称为 token 的 SHA-256,但是 BotToken 是可以更换的,如果创建者更换了 Token,将导致数据库不可用,所以计划换一个命名方法。
目前测试出现一个新的问题,如果某个 Json 字段为 null 或者不存在的情况下,Gson 将会忽略这个字段的解析(而且还不会调用字段类型的 Serializer 进行处理),导致这个 null-safety 属性为 null。
估计得要为部分配置类写一个 Serializer 来处理这个问题。
至于为啥用 Gson 不用 moshi,我记得是因为 Moshi 对简单 Json 处理不友好,所以没使用 Moshi。
看 Gson 官方估计是不把这个当问题的,得麻烦一下咯。
关联 Pull Request #8
把安装和使用的教程塞在 Readme 里,不利于详细说明呐,所以计划丢 Wiki 里,然后写详细一些,方便浏览。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.