Skip to content

Commit

Permalink
[Fix] 天气预报定时任务报错问题
Browse files Browse the repository at this point in the history
[Fix] 天气预报定时任务报错问题
  • Loading branch information
Cassius0924 authored Feb 4, 2024
2 parents 7f6ec48 + 0a32591 commit c5c2a4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wechatter/config/parsers/weather_cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from apscheduler.triggers.cron import CronTrigger

from wechatter.commands._commands.weather import _generate_weather_message
from wechatter.commands._commands.weather import get_weather_str
from wechatter.models.message import SendMessage, SendMessageType
from wechatter.models.scheduler import CronTask
from wechatter.sender import Sender
Expand Down Expand Up @@ -39,7 +39,8 @@ def func():
to_persons = task["to_persons"]
to_groups = task["to_groups"]
send_message = SendMessage(
type=SendMessageType.TEXT, content=_generate_weather_message(task["city"])
type=SendMessageType.TEXT,
content=get_weather_str(task["city"]),
)
Sender.send_msg_ps(to_p_names=to_persons, message=send_message)
Sender.send_msg_gs(to_g_names=to_groups, message=send_message)
Expand Down

0 comments on commit c5c2a4b

Please sign in to comment.