Skip to content

[Bug] Error 62 when trying to message a teacher. #103

@le-jacob

Description

@le-jacob

Describe the bug
When I try sending a message to a teacher with their ID, it doesn't work.
Sending to a classmate with their ID (that has "set_student_only(True)" enabled) works.
However this error also happens when I send a message to classmates without enabling set_student_only. That made me wonder if there was a similiar fix to that for teachers.

Your code

import edupage_api
eduthing = edupage_api.Edupage()
eduthing.login_auto(username="MYNAME", password="MYPASSWORD")

def eduaccount_fetch(names):
    people = eduthing.get_students()
    filtered_people = []
    for person in people:
        if person.name in names:
            filtered_people.append(person)
    for person in filtered_people:
        person.set_student_only(True)
    people = eduthing.get_teachers()

    for person in people:
        if person.name in names:
            filtered_people.append(person)
    ids = []
    for person in filtered_people:
        ids.append(person.get_id())
    return ids

receivers = eduaccount_fetch(["SOME TEACHER"])
eduthing.send_message(receivers, "testing testing")

Error message


Traceback (most recent call last):
  File "/home/lejacob/Documents/.my_dubiously_secret_path./edufetch", line 513, in <module>
    eduthing.send_message(receivers_2[1], message)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lejacob/.local/lib/python3.13/site-packages/edupage_api/__init__.py", line 152, in send_message
    return Messages(self).send_message(recipients, body)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/lejacob/.local/lib/python3.13/site-packages/edupage_api/messages.py", line 50, in send_message
    raise RequestError(
        "Failed to send message (edupage returned an empty 'changes' array) - https://github.com/EdupageAPI/edupage-api/issues/62"
    )
edupage_api.exceptions.RequestError: Failed to send message (edupage returned an empty 'changes' array) - https://github.com/EdupageAPI/edupage-api/issues/62


Expected behavior
It should send the message like it does for other classmates

Version

  • Edupage API version: (0.12.3)
  • Python version: (3.13.5)

Thank you for the contributions to this project people, this is really a gem of a project since i kinda hate using the website.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions