Use InviteMemberEvent instead of InviteEvent.
InviteMemberEvent is for when you're invited, whereas the latter is when there is an event in a room you're invited to, which has false positives.
This commit is contained in:
parent
2700cfcd7b
commit
22c5b46af0
1 changed files with 3 additions and 3 deletions
6
main.py
6
main.py
|
@ -7,13 +7,13 @@ from nio import (
|
|||
AsyncClient,
|
||||
AsyncClientConfig,
|
||||
RoomMessageText,
|
||||
InviteEvent,
|
||||
InviteMemberEvent,
|
||||
LoginError,
|
||||
LocalProtocolError,
|
||||
)
|
||||
from aiohttp import (
|
||||
ServerDisconnectedError,
|
||||
ClientConnectionError,
|
||||
ClientConnectionError
|
||||
)
|
||||
from callbacks import Callbacks
|
||||
from config import Config
|
||||
|
@ -49,7 +49,7 @@ async def main():
|
|||
# Set up event callbacks
|
||||
callbacks = Callbacks(client, store, config)
|
||||
client.add_event_callback(callbacks.message, (RoomMessageText,))
|
||||
client.add_event_callback(callbacks.invite, (InviteEvent,))
|
||||
client.add_event_callback(callbacks.invite, (InviteMemberEvent,))
|
||||
|
||||
# Keep trying to reconnect on failure (with some time in-between)
|
||||
while True:
|
||||
|
|
Loading…
Reference in a new issue