Skip to content

Commit 72ab45b

Browse files
committed
Implement __getitem__ on Event so it can be passed to async_util.run_func_with_args()
1 parent ed46f75 commit 72ab45b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cloudbot/event.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,12 @@ def is_nick_valid(self, nick):
372372
"""
373373
return self.conn.is_nick_valid(nick)
374374

375+
def __getitem__(self, item):
376+
try:
377+
return getattr(self, item)
378+
except AttributeError:
379+
raise KeyError(item)
380+
375381
if sys.version_info < (3, 7, 0):
376382
# noinspection PyCompatibility
377383
@asyncio.coroutine

0 commit comments

Comments
 (0)