Coder Social home page Coder Social logo

lamgc / scalabot Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 610 KB

Extensible robot server based on rubenlagus/TelegramBots (Using Java or kotlin)

License: MIT License

Kotlin 92.20% Java 7.70% Dockerfile 0.10%
bot-framework plug-in telegram telegram-bot

scalabot's Introduction

About Me

LamGC's github stats
Most used programming languages
osu-stats

“这不是开发的技术,这是开发的艺术!” ——《飞驰人生》(有更改)

Contact

KeyBase:KeyBase@LamGC
主要联系邮箱(Main contact email):[email protected]
工作专用邮箱(Work specific email):[email protected]

警告:请不要 向我的任何邮箱发送垃圾邮件包括但不限于 广告、非我本人订阅的邮件),我将会对相关邮件的发送者或来源地址进行封禁!
另外,请不要向我的工作专用邮箱发送与工作(或开发)无任何关系的内容(如果是咨询或闲聊等可发送至主要联系邮箱)。

GPG 公钥(如果需要验证签名,或与我保密通讯)(Get from KeyBase):LamGC <[email protected]> <[email protected]>
GPG Fingerpint:7EF5 FB1E 65C1 A6C6 D02D FCDF CE57 746D 7E5E E6EF


Profile visitcount


Profile visitcount By Visit Count Pro
Github Readme Stats By anuraghazra/github-readme-stats
Format specification By sparanoid/chinese-copywriting-guidelines
osu! stats card By solstice23/osu-stats-signature

scalabot's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

fossabot

scalabot's Issues

需要检查所有 Config 类,以确保在 Gson 解析 Json 时能正确使用参数默认值。

目前测试出现一个新的问题,如果某个 Json 字段为 null 或者不存在的情况下,Gson 将会忽略这个字段的解析(而且还不会调用字段类型的 Serializer 进行处理),导致这个 null-safety 属性为 null。

估计得要为部分配置类写一个 Serializer 来处理这个问题。

至于为啥用 Gson 不用 moshi,我记得是因为 Moshi 对简单 Json 处理不友好,所以没使用 Moshi。
看 Gson 官方估计是不把这个当问题的,得麻烦一下咯。

关联 Pull Request #8

更改常量的获取形式来让组件更容易测试。

使用常量不利于对组件进行测试,有必要改一下常量对象的获取形式了!
需要调整的常量有:

  • Const
  • AppPaths

经排查,使用 Const 的有:

  • AppMain.kt
  • AppConfig.kt

使用 AppPaths 的有:

  • AppMain.kt
  • AppConfig.kt
  • BotDBMaker.kt
  • ExtensionComponents.kt

计划的改动:

  • 将依赖常量对象的方法,将常量的依赖方式设计为方法参数的默认值;
  • [Reject] 使用自定的 Getter 方法提供常量,以此控制组件所使用的常量对象(比如在测试时提供预期的输入);

支持 TOML 配置文件格式。

由于 JSON 格式对普通用户不太友好(根据目前得到的用户反馈),因此计划支持 TOML 配置文件格式,以提高易用性。

需要改个名字!

ScalaBot 这个名字有太多项目使用了,需要改一个名字。
原本这个名字是 Scalable 跟 Telegram 结合而成的,但搜了一下发现一堆这个名字的项目。
所以得想个新的名字。

支持可选的 ExtensionPackageFinder 发现来源,并延迟扩展包的获取时机。

打算加个从 Maven 仓库(并不局限于 Maven **仓库)加载扩展的 ExtensionPackageFinder,但现有的扩展包发现机制会将从 Maven 仓库发现的扩展包视为冲突项,所以计划添加一个发现器优先级与选项,用于控制扩展包使用优先级与可选与否的操作。
所需细节:

  • 对于不同优先级的扩展包,取高优先级扩展包使用;
  • 对于最高优先级中存在多个包的,作为冲突处理(禁止加载);
  • 为发现器设计一个延迟获取扩展包的方式,用于在确定使用的情况下将扩展包从非本地来源传输至本地进行加载(或者直接加载,不过不安全);
  • (可能)允许发现器标记自己找到的依赖项为可选,此时即使优先级相同,也不会视为冲突;

修改 Bot 数据库文件名生成规则。

目前 Bot 的 MapDB 文件名称为 token 的 SHA-256,但是 BotToken 是可以更换的,如果创建者更换了 Token,将导致数据库不可用,所以计划换一个命名方法。

加一个给 Docker 容器用于检测容器健康状态的方法。

计划添加一个 Http 服务端,用于检查 ScalaBot 的运行状态,

举个例子(不一定是实际实现)

例如接口为 http://localhost:8800/healthy,接口的返回有以下类型:

  • HTTP 200:ScalaBot 已启动完成,状态良好
  • HTTP 500:ScalaBot 出现异常,无法提供服务
  • HTTP 100:ScalaBot 正在启动中

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.