Commit Graph

177 Commits

Author SHA1 Message Date
d408fa2561
for UserRandom requires the surrounding space between 'or' to avoid mismatches. 2024-05-06 17:16:43 +08:00
7e8e66fcbb
deprecated ip186 (and command /ip /whois) 2024-05-06 17:12:52 +08:00
a07c0b1b18
fixed weibo m.weibo.cn/status/<id> unavailable 2024-03-07 18:50:21 +08:00
2ae1777a93
fix some BiliForm tests 2024-02-14 20:15:43 +08:00
35c9eeb9a4
Update the algorithm for 2^51 ranges AV/BV conversion. 2024-02-14 20:06:32 +08:00
9814b3ccab
fix Bilibili av/bv conversion failed when avid > 2^30 2024-02-13 14:04:49 +08:00
c4632263de
make private url share can get from content 2023-12-02 21:11:33 +08:00
ad65ab7a73
SocialContent add non-pic alternative 2023-11-30 00:13:29 +08:00
20c9916535
add show retweet weibo 2023-11-29 21:08:08 +08:00
79d41d5e72
basic inline get social function
- Now supported get social content from inline
  - use a supported url with prefix or suffix "get"
  - only support twitter photos media
  - support all types of pure text content.
  - trying get non-supported medias may cause failure.
2023-11-29 17:16:02 +08:00
3d1699ea1d
move external API docking code to extra package from data 2023-11-29 00:15:13 +08:00
a9767ec1b0
change /tweet to /get and added support for weibo content 2023-11-27 18:58:35 +08:00
d602e1b366
set morny UA for all HTTP req, add twitter tests 2023-11-23 17:57:29 +08:00
43cdf221d9
fix request client failed caused unexpected exception 2023-11-22 16:06:15 +08:00
f8b2d056cc
FixTweet api implement, with a /tweet command 2023-11-21 23:35:12 +08:00
2687c3be88
add FixTweet, removed c.vxtwitter 2023-11-20 17:12:10 +08:00
c5c6683459
for event, fix wrong OK stats, add CANCELED tag
- Now the status of EventEnv is a State array that infers the state history
  - State can be OK or CANCELED, and can be set multiple times
  - state method can get the last state set, and status method can get the state history
  - Default EventListener.executeFilter implementation is changed to true if stats is null
- add consume[T](T=>Unit) for EventEnv, to simplifying the old consume[T](Class[T])(T=>Unit)
- changed execution sort of EventListener in EventListenerManager. Now atEventPost method will be run after all events' normal listeners complete.
- cha OnMedicationNotifyApply will only tag event as OK when the refresh function works (fixed part of the wrong OK state)
- cha MornyOnUpdateTimestampOffsetLock tag event CANCELED but not OK to fix part of the wrong OK state
2023-11-20 11:18:32 +08:00
7ee4a0d3c5
add code language support for event_hack and exception report 2023-11-17 01:19:22 +08:00
720771719e
add err handler for UpdateListener
- add err handler for UpdateListener in MornyCoeur
  - for network-related exception, will only output exception basic message and not report.
  - for other type of exception, will output all message of exception and do report.
- Scheduler's runnerName now is `$classBaseName@$hashCode`
2023-11-16 20:06:15 +08:00
2c30b5ec09
add event statistics, fix CronTask
- add for EventEnv a timeStartup field
- cha EventListener and EventListenerManager
  - add for EventListener a method executeFilter used to manager if an event should be run. This replaced the condition statement inside the EventListenerManager
  - add for EventListener a method atEventPost, this will run at current event listener is on complete
- add for MornyConfig a reportZone field
  - can be set by `--report-zone`
  - used for controlling Morny Report daemon uses the zoned time to send report. default is system default time zone.
- add for MornyReport new EventStatistics and DailyReportTask
- add for MornyInformation command new subcommand `event` to manually show MornyReport.EventStatistics info.
- add WatchDog and MornyCoeur.watchDog, used for checking if the machine is in sleep mode and notify the MornyCoeur.tasks to avoid timing problem
- fix CronTask frequency got initialize problem
- add slf4j-nop for project
2023-11-14 13:56:23 +08:00
3d44972233
add CronTask, tests optimize
- add lib cron-utils: v9.2.0
- add CronTask
  - add CronTask's test
- change MedicationTimer using cron as time calculation backend (not using CronTask)
- change OnQuestionMarkReply support `⸘`
- minor SchedulerTest "immediately" test logic changes
2023-11-09 22:07:10 +08:00
89c414e853
Merge branch 'master' into 1.3.0 2023-11-08 18:33:42 +08:00
81ba776c7d
fix InputCommand throws OutOfBounds while input is empty 2023-11-05 19:47:33 +08:00
d5c852e989
fix *.cdn-telegram.org 2023-11-05 19:33:35 +08:00
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
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
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
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
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
6e82227447
bug fix for scala port 2023-09-17 15:18:57 +08:00