Commit Graph

121 Commits

Author SHA1 Message Date
30c5ae71cc
[[release 1.1.0*nanchang]]
## 📇 Function & Mechanisms

- add /chuang command (from @autoziyaobot)
- add 尊嘟假嘟 reply event (from @hasutestbot)

## 🧯 Bug Fix

- fix OnQuestionMarkReply false-checked message due to a huge amount of repeating normal message
2023-10-09 22:09:20 +08:00
692abb9f56
fix OnQuestionMarkReply false-trigger, add 尊嘟假嘟 2023-10-09 21:51:22 +08:00
253208e830
add /chuang 2023-10-09 18:32:36 +08:00
49bbc03ec0
[[[release 1.0.0*beiping]]]
## 📇 Function & Mechanisms

- new /info command
  - root /info command with new introduction page design
  - /start command with new design like new /info
  - /version and /runtime merged to /info
    - old command still available though been hidden
- new "/x?" in random tools
- new function: reply ? for a ?

## 🔌 for Trusted/Admin

- new MornyReport report exceptions or startup/exit events to telegram chat
- cha *msg supported body-less send check

## 🔩 for self-hosted/developer

- Project port to Scala
- add Dockerfile & docker-compose.yml
- add param for Medication Timer
  - param: --medication-notify-chat / -medc
  - param:--medication-notify-timezone / -medtz
  - param: --medication-notify-times / -medt
- cha unset default params (--master ect. is -1 as default)
  - add ID_501 as Morny function return while not supported by provided master

## 🧯 Bug Fix

- fix unclosed quote will cause exceptions while parsing command.
- fix some hidden command cannot execute due to no support to non-ascii command name. (also changed its behavor while I won't tell too much here)
- fix error while converting millisecond to nanosecond in Medication Timer
- inline query ShareBilibiliVideo now will not receive illegal av/BV id which can cause exceptions.
- /nbnhhsh will now send 404 when there's no input text.
- fix --trusted-chat -1 will caused MornyTrusted throws exception, now it will judge(ignore) the value as design.
- fixed --report-to -1 not process normally
- added missing --dinner-chat startup param.
- Some minor fixes while porting coeur to scala is not listed.
2023-10-09 15:46:30 +08:00
45a85e15f5
unset all function defaults config, fix universal command parse
unset the following defaults value:
  - master
  - trusted chat
  - dinner chat id
  - report to chat
  - medication notify to chat
and make the related function can be shutdown by the new -1 defaults:
  - MedicationTimer daemon will not run when medication-notify-to-chat or notify-at-hour is not set
  - MornyReport will do not report when report-to is not set
  - OnCallMe will send ID_501 when there's no master
  - OnCallMe.requestLastDinner will send ID_501 when there's no dinner-chat

fix when using universal command parse may throw exception
2023-10-07 22:07:00 +08:00
69086b1f36
publish 1.0.0-RC5 2023-10-06 21:42:50 +08:00
1bd795873c
code optimize
- add UseSelect
- add scaladoc for some internal trait
- code optimize, mostly use Option now
2023-10-06 20:55:26 +08:00
bfacb0d039
refactor ExtraAction to TelegramExtensions, some coeur startup changes
- refactor ExtraAction to TelegramExtensions
  - make exec a TelegramBot extension
  - refactor isUserInGroup to Chat extension hasMember and memberHasPermission
  - added LimBoUser and LimboChat for capability
- deleted TelegramUpdatesListener, and make EventListenerManager implemented UpdatesListener
- change some value definition, change startup and exit process in MornyCoeur
  - removed updatesListener, extract its manager to eventManager in Coeur
  - added account.shutdown before other's
  - moved Morny's startup/exit report to Coeur
  - change exitCleanup thread name from "morny-exiting" to "system-exit"
2023-09-23 21:44:06 +08:00
511036e2ce
refactor runtime context from class instance to using/given 2023-09-23 16:38:07 +08:00
92aa0e260e
Merge branch 'scala' into 'master' 2023-09-18 22:49:01 +08:00
6e82227447
bug fix for scala port 2023-09-17 15:18:57 +08:00
a8b7562b51
complete scala port 2023-09-16 23:12:44 +08:00
ddfe77350e
scala port stage3 (not tested) 2023-09-10 22:43:39 +08:00
1a31a22cd9
scala port stage2 (not tested) 2023-09-07 22:15:06 +08:00
aafdcc1fb2
scala port stage1 (not tested) 2023-09-05 14:14:01 +08:00
213798dab7
added /info(main) and /start, added support for assets
- add /info (without subcommand)
  - add about pic
  - add morny about links
- add MornyAssets to manager & use assets
- add TelegramImages to manager images that in use
  - with a AssetsFileImage
  - with IMG_ABOUT
- add MornyAbout
  - changed MornyHello to MornyAbout
  - add about links (used in /info)
- remove HelloOnStart
2023-08-27 13:00:36 +08:00
7589e8661d
added --dinner-chat startup param, code quality optimization.
- added `--dinner-chat`/`-chd` startup param for setup dinner chat id
- fixed some unclosed resource
  - TrackerDataManager changed method to get FileChannel (I don't know if it works)
  - MornyCLI scanner uses try-with-resources
- declared directly used dependencies
  - okhttp: 4.11.0
  - gson: 2.10.1
- some minor refactors
  - MornyCoeur.main rename to .init
  - added package `internal` and move @BuildConfigField to it
  - added new util class OkHttpPublic with MediaTypes in use
  - added javadoc for TrackerDataManager
  - and so on...
2023-08-20 23:11:10 +08:00
69a33933f5
add docker, update gradle wrapper
- added Dockerfile and simple example docker-compose.yml
- upgrade gradle wrapper: 7.5.1 -> 8.2.1
- tiny code refactor
2023-08-15 14:10:13 +08:00
518bde9404
put Welcome Message echo first 2023-04-08 15:01:12 +08:00
e153d9e47f
support log level setting; remove git submodule _book; bug fix.
- update dependencies
  - messiva: 0.1.0.1 -> 0.1.1
- add param -d/--dbg/--debug to enable the Debug/Trace log output.
- fix UniversalCommand occurs ArrayOutOfBounds while the quotes not closed.
2023-04-08 13:10:36 +08:00
9c03a59512
fix input av/bv may be too long or too small to process 2023-04-07 16:55:09 +08:00
f990df70ea
/nbnhhsh will send 404 while no content, add some javadoc 2022-12-24 23:18:49 +08:00
031a799070
support QuestionMarkReply to reply more than 1 mark char message. add javadoc 2022-11-20 12:45:20 +08:00
0e3a9d3f9b
add function to randomly reply "?" message, added a CommonRandom tool, replace all jb.NotNull to javax.Nonnull 2022-11-19 23:27:45 +08:00
17c29036b3
add a function "if something?" to OnUserRandoms
- and now uses @Deprecated not @SuppressWarnings("unused") to tag those unused event.
2022-11-19 22:48:20 +08:00
8e28bbbce1
add -medc/medt/medtz params and configs for customize MedicationTimer status, fix millis/nanos conv problem again
- add configs for medication timer
  - medicationNotifyToChat
    - default is -1001729016815L(Annie medication notify chat)
    - add param --medication-notify-chat / -medc to set it, accept a long number.
  - medicationTimerUseTimezone
    - default is ZoneOffset.UTC(means +00:00)
    - add param --medication-notify-timezone / -medtz to set it, accept a number that means timezone hours
  - medicationNotifyAt
    - default is a empty Set
    - add param --medication-notify-times / -medt to set it, accept a hour(0~23) list seperated by ","
- now medication timer will exit if the notify-times is empty
 - changed the Test data-source for MedicationTimer#calcNextRoutineTimestamp
2022-11-18 17:49:39 +08:00
2ffab30ef1
fix error while converting millis to nanos in MedicationTimer 2022-11-17 13:54:48 +08:00
2c7c4a2a6b
变更吃药提醒为 12:00 一次,修改了吃药提醒的时间计算方式,为吃药提醒的时间计算添加了一个测试
- 将吃药提醒的时间计算变更为基于 LocalDateTime 的计算
  - 为其添加了 USE_TIME_ZONE 和 NOTIFY_AT_HOUR 两个参数
2022-11-13 13:22:17 +08:00
a83930efd0
修复未预见 --report-to 设置为 -1 的问题 2022-11-12 17:40:51 +08:00
a863570be2
Merge branch 'major/1.0' 2022-11-12 16:13:51 +08:00
c4a709491d
为 loginReport 添加了版本号,重构 version/runtime 的内部调用链
- 修改了 system 的显示方式将 os名称/版本/架构 移为了一行
- 将 version/runtime 的执行体移动到了 MornyInformations 当中
- MornyInformations 中对一些复杂的 version/runtime 部件为其独立出了一个方法
2022-11-12 13:42:23 +08:00
fbbfe73ac1
修改了 "meow-set" 部分的文案,并为其添加了特异化回复的功能,修复其以及 --report-to 的 bug
- 修复了上次提交的 --report-to 参数没有被正确处理问题
- 创建了一个新的补丁事件,修复了 meow-set 无法使用的问题
2022-11-11 18:32:44 +08:00
3689962cb3
添加了 morny login/exit 的报告,*msg 现在支持了只包含发送 id 不包含发送体
- 为 MornyCoeur 添加了 whileExitReason (exit/getExitReason) 接口,用于安全退出时指定推出原因
- MornyConfig 添加了一个 Sensitive 注解用于标明字段值属于敏感字段不应该被打印
-
2022-11-11 16:37:24 +08:00
01b4eea917
为error和exit/save 403 实现了 Morny Report,trustedChat= -1,typo 以及文案 fix
- 优化了 coeur 中 exception 的 stackTrace 的输出方式
  - 大幅度修改了 EventListenerManager 中报错的逻辑使其更加正常了许多
- 添加了 reportToChat 以及 --report-to 选项用在 MornyReport 中
- 为 coeur 中的错误报告添加了 MornyReport.exception
- 为 save/exit 两个需要权限的命令添加了 MornyReport.unauthenticatedAction
- 添加了一个方法可以检查 coeur(telegram_bot) 是否已完成初始化以存取 coeur 的内容
2022-11-10 23:06:52 +08:00
837ec178d3
将带有 git 的 version 更名为 version-full,原先的 version 去除 git 等附加属性,作为 maven 包版本使用 2022-11-09 12:03:17 +08:00
48a8fd9daa
修复 /info 无参数的错误反应 2022-11-09 01:48:03 +08:00
201c8bcd1a
添加项目 git 链接相关配置,大改动版本显示方式,/version 与 /runtime 合并进 /info
- 将 /version 和 /runtime 合并为了 /info 的子命令
  - 旧的 /version 和 /runtime 命令仍然可用
  - runtime 现在是 /info 的无参数行为
- 更新了各种位置的版本显示方式
  - /version 现在通过组装的方式显示版本号的 BASE 与 DELTA 部分,并支持了可能的 git commit 显示,同时支持输出 commit 链接
  - /runtime 现在通过组装的方式显示版本号的 BASE, DELTA, GIT 部分,其中也支持了 git commit 链接,同时 CODENAME 的显示方式规范为了 `version*CODENAME` 的格式
  - ServerMain 的 -v 修改了显示格式,同时添加了 gitstat 字段显示 build 时的 git 信息
  - ServerMain 的启动版本回显(仍使用完全体VERSION)将 md5hash 和 code-time 移到了新行
- dependencies update
  - java-telegram-bot-api: 5.6.0 -> 6.2.0
2022-11-09 01:41:01 +08:00
f362d08f34
更新了打包配置
- 设置了全局 archivesBaseName
- 对一些属性的声明方式进行了调整
- 为 maven publish 添加了动态配置,以在没有配置 publish url 的机器上也能够正常运行基础功能
- gradle plugin: shadow: 7.1.0 -> 7.1.2
- gradle wrapper: 7.3 -> 7.5.1
- 稍微修改了 git 状态的 log 输出方式
2022-11-07 12:54:01 +08:00
3c7de7037d
将 COMPILE_TIMESTAMP 改为基于 commit time 的 CODE_TIMESTAMP 2022-11-06 21:51:19 +08:00
e3c273b370
将 GradleProjectConfigures 变更为使用 BuildConfig 工具,添加了 version_delta
- archiveBaseName 更名为 'morny-coeur'
- 现在在 getJarMd5 时遇到文件读写错误不会再输出错误堆栈信息了
- gradle 基本的参数化
2022-11-06 20:07:11 +08:00
c2de1b8748
添加了 MornyConfig 以及修改代码基于 MornyConfig 2022-11-06 17:52:48 +08:00
5f8cbcffd6
关闭 tracker 功能 2022-11-02 16:03:35 +08:00
2fa6950e4e
新增了 bilibili 视频分享的内联查询功能
- 添加 bilibili 视频分享的内联查询可以输入 av/bv 号或是视频链接
  - 可以输出为带有 av 视频链接的 av 号,或是 bv 视频链接的 bv 号
- 添加 BiliTool 工具可以互转 bilibili av/bv 号
2022-10-18 20:28:06 +08:00
58b6f863bd
/encrypt 添加 base64 对 base64url 格式的支持 2022-10-18 16:26:36 +08:00
5bb19095c8
添加了新的内联查询功能支持将 twitter 分享链接重新输出为 vxtwitter 分享链接同时去跟踪参数,将 ITelegramQuery 抽象层的要求返回从单个限定类别 queryUnit 改为 list<queryUnit<?>>
- 通过 tgapi.NamedUtils#inlineIds 规范化了 InlineQuery 的 id 定义
  - 将 raw text 的 id 重新定义为规范化行为
  - 将 my information 的 id 重新定义为规范化行为
2022-10-17 17:44:12 +08:00
e31dd6a0fb
/encrypt 现在支持了图片 // 设置版本 CODENAME 为 putian 2022-10-15 17:51:56 +08:00
f195d5c1bb
添加了 /info stickers 命令可以(通过反射)列出 morny 所定义的所有贴纸或是某贴纸名称所定义的贴纸 2022-10-15 17:16:03 +08:00
e947c3f239
为 /encrypt 添加了简单的文件处理支持,添加了 NETWORK_ERR 反馈贴纸(,添加了一个没用的 /test 命令) 2022-10-15 00:01:35 +08:00
dd8f7c0cd5
添加了 /encrypt 工具命令 (currently只支持回复文本消息作为数据体) 附带 uppercase 参数 2022-10-09 16:50:42 +08:00
7bb179658e
添加了一个可以抽取 "debian安装镜像" 的命令 /install 2022-10-05 21:19:45 +08:00