Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MastodonMalformedEventError: ('Bad event type', u'announcement.reaction') #218

Closed
allo- opened this issue Aug 25, 2020 · 3 comments
Closed

Comments

@allo-
Copy link

allo- commented Aug 25, 2020

I get errors for announcment reactions in a UserListener:

mastodon.Mastodon.MastodonMalformedEventError: ('Bad event type', u'announcement.reaction')

I tried upgrading Mastodon.py, but the error seems not to be fixed in the latest release on pypi.

@halcy
Copy link
Owner

halcy commented Aug 25, 2020

Yeah, it doesn't have support for "announcement" type events yet, and I will not be doing maint to add support in the next few months (sorry). If you feel like it, you could try patching support in (shouldn't be too hard), or just ignore try / except the errors out. If you do submit a PR I'll merge it and push a pypi release.

@bortzmeyer
Copy link

Any news since? I use Mastodon.py 1.5.1 and I get from time to time in my listener the same exception "('Bad event type', 'announcement.reaction')".

@arittner
Copy link
Collaborator

Hello @allo- and @bortzmeyer

It's now possible to add an own listener function with the name on_announcement_reaction to react on this event. To manage unknown events (that can happen with any new mastodon instance version), you can override on_unknown_event and handle it on your way.

Alternatively, a callback function can be passed in the unknown_event_handler parameter in the CallbackStreamListener constructor.

Before we release it, maybe you can test it from the current source. This means, you should download the sources and install Mastodon.py locally:

pip install -e /path/to/your/mastodon-py/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants