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,
|
AsyncClient,
|
||||||
AsyncClientConfig,
|
AsyncClientConfig,
|
||||||
RoomMessageText,
|
RoomMessageText,
|
||||||
InviteEvent,
|
InviteMemberEvent,
|
||||||
LoginError,
|
LoginError,
|
||||||
LocalProtocolError,
|
LocalProtocolError,
|
||||||
)
|
)
|
||||||
from aiohttp import (
|
from aiohttp import (
|
||||||
ServerDisconnectedError,
|
ServerDisconnectedError,
|
||||||
ClientConnectionError,
|
ClientConnectionError
|
||||||
)
|
)
|
||||||
from callbacks import Callbacks
|
from callbacks import Callbacks
|
||||||
from config import Config
|
from config import Config
|
||||||
|
@ -49,7 +49,7 @@ async def main():
|
||||||
# Set up event callbacks
|
# Set up event callbacks
|
||||||
callbacks = Callbacks(client, store, config)
|
callbacks = Callbacks(client, store, config)
|
||||||
client.add_event_callback(callbacks.message, (RoomMessageText,))
|
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)
|
# Keep trying to reconnect on failure (with some time in-between)
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in a new issue