Fix python late binding behaviour.

This commit is contained in:
Ceda EI 2019-05-16 18:53:36 +05:30
parent 0b72b789ff
commit a35071bd64
1 changed files with 2 additions and 1 deletions

3
bot.py
View File

@ -48,7 +48,8 @@ rooms = matrix_bot.get_rooms()
for chan_id, room_id in config.mappings:
client.add_event_handler(
lambda x: send_to_matrix(x, rooms[room_id], matrix_bot),
lambda x, room_id=room_id: send_to_matrix(x, rooms[room_id],
matrix_bot),
events.NewMessage(chats=[chan_id])
)