调整msg日志级别
This commit is contained in:
22
main.py
22
main.py
@@ -4,28 +4,11 @@
|
||||
import signal
|
||||
from argparse import ArgumentParser
|
||||
|
||||
from base.func_report_reminder import ReportReminder
|
||||
from configuration import Config
|
||||
from constants import ChatType
|
||||
from robot import Robot, __version__
|
||||
from wcferry import Wcf
|
||||
|
||||
|
||||
def weather_report(robot: Robot) -> None:
|
||||
"""模拟发送天气预报
|
||||
"""
|
||||
|
||||
# 获取接收人
|
||||
receivers = ["filehelper"]
|
||||
|
||||
# 获取天气,需要自己实现,可以参考 https://gitee.com/lch0821/WeatherScrapy 获取天气。
|
||||
report = "这就是获取到的天气情况了"
|
||||
|
||||
for r in receivers:
|
||||
robot.sendTextMsg(report, r)
|
||||
# robot.sendTextMsg(report, r, "notify@all") # 发送消息并@所有人
|
||||
|
||||
|
||||
def main(chat_type: int):
|
||||
config = Config()
|
||||
wcf = Wcf(debug=True)
|
||||
@@ -46,14 +29,9 @@ def main(chat_type: int):
|
||||
# robot.enableRecvMsg() # 可能会丢消息?
|
||||
robot.enableReceivingMsg() # 加队列
|
||||
|
||||
# 每天 7 点发送天气预报
|
||||
# robot.onEveryTime("07:00", weather_report, robot=robot)
|
||||
|
||||
# 每天 8:30 发送新闻
|
||||
robot.onEveryTime("08:30", robot.newsBaiduReportAuto)
|
||||
|
||||
# 每天 16:30 提醒发日报周报月报
|
||||
# robot.onEveryTime("10:30", ReportReminder.remind, robot=robot)
|
||||
# epic
|
||||
robot.onEveryTime("10:30", robot.sendEpicFreeGames)
|
||||
|
||||
|
||||
3
robot.py
3
robot.py
@@ -137,7 +137,6 @@ class Robot(Job):
|
||||
else: # 接了 ChatGPT,智能回复
|
||||
# 去除@的人和空格等字符
|
||||
q = re.sub(r"@.*?[\u2005|\s]", "", msg.content).replace(" ", "")
|
||||
print(f"toChitchat{q}")
|
||||
# 所有人员都可以要求他撤回刚刚的信息
|
||||
if q == '撤回':
|
||||
self.revoke_messages(msg.roomid)
|
||||
@@ -246,7 +245,7 @@ class Robot(Job):
|
||||
|
||||
def onMsg(self, msg: WxMsg) -> int:
|
||||
try:
|
||||
self.LOG.debug(msg) # 打印信息
|
||||
self.LOG.info(msg) # 打印信息
|
||||
self.processMsg(msg)
|
||||
except Exception as e:
|
||||
self.LOG.error(e)
|
||||
|
||||
Reference in New Issue
Block a user