python报错是哪里出问题了

import itchat
import time

登录微信

itchat.auto_login(hotReload=True)

获取微信群的UserName(通过itchat.search_chatrooms函数或手动获取)

group_username = '群聊的UserName'

定时发送消息的函数

def send_message():
message = "要发送的消息"
itchat.send(message, toUserName=group_username)

定时任务

def schedule_task():
while True:
# 获取当前时间
current_time = time.strftime('%H:%M', time.localtime())

    # 设置发送时间,例如每天的10:30发送消息
    if current_time == '10:30':
        send_message()

    # 休眠一段时间,避免频繁检查时间
    time.sleep(60)

启动定时任务

schedule_task()

参考GPT和自己的思路:这份代码可能存在SyntaxError语法错误或IndentationError缩进错误,无法直接确定报错具体位置。可以尝试使用Python的IDE或者命令行执行代码,看看抛出的具体异常信息有哪些,并根据异常信息来查找问题所在位置和原因。

报什么错?