diff --git a/plugin_moyu/nowork.go b/plugin_moyu/nowork.go index 006d67ea..e13ad74d 100644 --- a/plugin_moyu/nowork.go +++ b/plugin_moyu/nowork.go @@ -2,6 +2,7 @@ package moyu import ( "fmt" + "strconv" "time" ) @@ -20,7 +21,7 @@ func NewHoliday(name string, dur, year int, month time.Month, day int) *holiday func (h *holiday) String() string { d := time.Until(h.date) if d >= 0 { - return "距离" + h.name + "还有: " + d.String() + return "距离" + h.name + "还有: " + strconv.FormatFloat(d.Hours()/24.0, 'f', 2, 64) + "天!" } else if d+h.dur >= 0 { return "好好享受 " + h.name + " 假期吧!" } else { diff --git a/plugin_moyu/run.go b/plugin_moyu/run.go index 04dbcc9b..5f4970b9 100644 --- a/plugin_moyu/run.go +++ b/plugin_moyu/run.go @@ -65,8 +65,7 @@ func sendNotice() { ctx.SendGroupMessage(grp, []message.MessageSegment{ message.Text(time.Now().Format("2006-01-02")), - message.Text("上午好,摸鱼人!\n工作再累,一定不要忘记摸鱼哦!有事没事起身去茶水间,去厕所,去廊道走走别老在工位上坐着,钱是老板的,但命是自己的。"), - message.Text("\n"), + message.Text("上午好,摸鱼人!\n工作再累,一定不要忘记摸鱼哦!有事没事起身去茶水间,去厕所,去廊道走走别老在工位上坐着,钱是老板的,但命是自己的。\n"), message.Text(weekend()), message.Text("\n"), message.Text(NewHoliday("元旦", 1, 2022, 1, 1)), @@ -83,7 +82,7 @@ func sendNotice() { message.Text("\n"), message.Text(NewHoliday("国庆节", 7, 2022, 10, 1)), message.Text("\n"), - message.Text("\n\n上班是帮老板赚钱,摸鱼是赚老板的钱!最后,祝愿天下所有摸鱼人,都能愉快的渡过每一天…"), + message.Text("上班是帮老板赚钱,摸鱼是赚老板的钱!最后,祝愿天下所有摸鱼人,都能愉快的渡过每一天…"), }, ) }