Commit Graph

196 Commits

Author SHA1 Message Date
9f908aa88e
add scaladoc, change Long to EpochMillis, scheduler tests
- fix wrong Telegram EpochSeconds to EpochMillis conv at OnCallMe
2023-11-05 19:25:00 +08:00
f0d4471646
add some scaladoc for scheduler 2023-11-04 19:38:40 +08:00
b57d87dece
add basic Scheduler and interval tasks
- MedicationTimer refactor using new scheduler
- add `/info tasks` for monitoring morny global tasks
2023-11-03 20:23:32 +08:00
adb91a06d5
[[release 1.2.1]]
- fix featured-image error
- fix morny startup report missing `@` in username field
2023-10-20 21:31:14 +08:00
c9a9b846c9
fix featured-image error 2023-10-20 21:26:58 +08:00
e6b68ae307
code optimize
and change debug logs on Nbnhhsh command to trace logs
2023-10-20 11:45:58 +08:00
c19134811d
change Morny use sttp as http client 2023-10-19 21:43:29 +08:00
a32018d600
fix morny test package path problem, add test for hash file and NamingUtils 2023-10-18 23:40:17 +08:00
e7f403202d
fix @ in username is missing on startup report 2023-10-18 22:52:55 +08:00
69e9459ebc
[[release 1.2.0*xiongan]]
## 📇 Function & Mechanisms

- add for /encrypt
  - add urlencode / urldecode sub-command: they process text input only
  - add alias /enc
- add for InlineBilibiliShare
  - add b23.tv share-link parse
  - add b23.tv video link parse

## 🔩 for self-hosted/developer

- cha EventListener use EventEnv instead of Update
- new LogLevel NOTICE(notice) and ATTION(attention)
  - with new formatter
2023-10-18 17:25:41 +08:00
40bdbec1ec
add tests for BilibiliForms, support b23 video link and better v-part parse 2023-10-17 18:49:57 +08:00
60dbcef140
add urlencode/decode for /encrypt, add b23.tv parse for InlineBilibiliShare 2023-10-17 14:16:29 +08:00
79206dd13b
new logger level and formatter
- add MornyLogLevels with new log level NOTICE(notice) and ATTION(attention)
  - make mechanic and morny (but not coeur) related INFO to NOTICE, warn to ATTION
- add MornyFormatterConsole to support the formatted time display, and some other formatter changed
- now startup key output will hide key except the starting and ending 4 chars
- change the function definition of consume in EventEnv
- removed src/test/scala/live/LiveMain
  - and added gitignore for src/test/scala/live
2023-10-15 21:14:54 +08:00
9c433ba0ab
use EventEnv as event encapsulate instead of Update
- make MornyOnTelegramCommand provides InputCommand
  - change OnUniMeowTrigger consume InputCommand
2023-10-12 18:10:11 +08:00
1b3a847fc8
update gradle build src for capability with IDEA 2023-10-12 14:39:18 +08:00
b305f52493
[[release 1.1.1]]
## 📇 Function & Mechanisms

- cha 尊嘟假嘟 from full match to endswith match

## 🧯 Bug Fix

- fix MedicationTimer thread controller fault

## 🔩 for self-hosted/developer

- change param --outdated-block to --outdated-ignore
  - deprecated param --outdated-block
2023-10-11 18:22:36 +08:00
9ec10a6674
complete some encrypt test and InputCommand test 2023-10-11 16:56:54 +08:00
12a49b71d1
fix Medication Timer wrong sleep, fix 尊嘟假嘟 match 2023-10-11 16:04:17 +08:00
51d0f2a75b
cha 尊嘟假嘟 from full-match to endswith match 2023-10-11 15:32:45 +08:00
0898d08fa7
add MedicationTimerTest 2023-10-10 15:19:41 +08:00
b617b3e059
change outdated-block to outdated-ignore
- and remove config field eventOutdatedTimestamp
2023-10-10 13:37:43 +08:00
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
985fde9aa2
fix sources jar gen in scala 2023-10-06 22:24:14 +08:00
981098cf6e
update README 2023-10-06 21:52:31 +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