mirai-CrazyThursdayPlugin:肯德基疯狂星期四推送插件喜加一
-
基于mirai-console的插件,在每周四的8:00~20:00, 每逢整点推送疯狂星期四段子。
灵感来自 肯德基疯狂星期四! 推送插件。
使用java编写,使用了quartz实现定时任务。
段子来自 https://github.com/Nicr0n/fucking_crazy_thursday来个dalao教我java吧,孩子要学不懂了 -
报错
2022-12-29 08:00:00 W/stderr: java.nio.charset.MalformedInputException: Input length = 1
2022-12-29 08:00:00 W/stderr: at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)
2022-12-29 08:00:00 W/stderr: at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:389)
2022-12-29 08:00:00 W/stderr: at java.base/sun.nio.cs.StreamDecoder.lockedRead(StreamDecoder.java:219)
2022-12-29 08:00:00 W/stderr: at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:173)
2022-12-29 08:00:00 W/stderr: at java.base/java.io.InputStreamReader.read(InputStreamReader.java:189)
2022-12-29 08:00:00 W/stderr: at java.base/java.io.BufferedReader.fill(BufferedReader.java:161)
2022-12-29 08:00:00 W/stderr: at java.base/java.io.BufferedReader.implReadLine(BufferedReader.java:371)
2022-12-29 08:00:00 W/stderr: at java.base/java.io.BufferedReader.readLine(BufferedReader.java:348)
2022-12-29 08:00:00 W/stderr: at java.base/java.io.BufferedReader.readLine(BufferedReader.java:437)
2022-12-29 08:00:00 W/stderr: at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar//datas.DataManager.readPointLine(DataManager.java:45)
2022-12-29 08:00:00 W/stderr: at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar//datas.DataManager.sendCrazy(DataManager.java:35)
2022-12-29 08:00:00 W/stderr: at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar//file.CrazyPluginManager.sendCrazyToGroup(CrazyPluginManager.java:28)
2022-12-29 08:00:00 W/stderr: at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar//time.CrazyJob.execute(CrazyJob.java:11)
2022-12-29 08:00:00 W/stderr: at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar[private]//org.quartz.core.JobRunShell.run(JobRunShell.java:202)
2022-12-29 08:00:00 W/stderr: at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar[private]//org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
2022-12-29 08:00:00 E/org.quartz.core.JobRunShell: Job sendCrazyGroupJob.CrazyJob threw an unhandled Exception:
java.lang.NullPointerException: Parameter specified as non-null is null: method net.mamoe.mirai.contact.Group.sendMessage, parameter message
at net.mamoe.mirai.contact.Group.sendMessage(Group.kt)
at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar//file.CrazyPluginManager.sendCrazyToGroup(CrazyPluginManager.java:29)
at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar//time.CrazyJob.execute(CrazyJob.java:11)
at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar[private]//org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar[private]//org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)2022-12-29 08:00:00 E/org.quartz.core.ErrorLogger: Job (sendCrazyGroupJob.CrazyJob threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException: Parameter specified as non-null is null: method net.mamoe.mirai.contact.Group.sendMessage, parameter message]
at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar[private]//org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar[private]//org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method net.mamoe.mirai.contact.Group.sendMessage, parameter message
at net.mamoe.mirai.contact.Group.sendMessage(Group.kt)
at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar//file.CrazyPluginManager.sendCrazyToGroup(CrazyPluginManager.java:29)
at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar//time.CrazyJob.execute(CrazyJob.java:11)
at mirai-CrazyThursdayPlugin-0.1.0.mirai2.jar[private]//org.quartz.core.JobRunShell.run(JobRunShell.java:202)
... 1 more![89XR99]ZDN_O~MR0T(BGUZ7.png](/assets/uploads/files/1672272370512-4177d6bf-9d77-4329-be59-a2ace7a65ce3-89xr99-zdn_o-mr0t-bguz7.png)
-
好!很有精神,提醒一下,今天就是2022年最后一个疯狂星期四了
-
大佬,怎么写的,我想写个周日版本的,能教一教么