Add type hint for return type of IRCBot.trigger
This commit is contained in:
parent
dfbc727dc7
commit
e1cdd4a353
1 changed files with 2 additions and 1 deletions
|
@ -33,7 +33,8 @@ class Bot(object):
|
|||
self._events.on("timer.reconnect").hook(self._timed_reconnect)
|
||||
|
||||
def trigger(self,
|
||||
func: typing.Optional[typing.Callable[[], typing.Any]]=None):
|
||||
func: typing.Optional[typing.Callable[[], typing.Any]]=None
|
||||
) -> typing.Any:
|
||||
func = func or (lambda: None)
|
||||
if threading.current_thread() is threading.main_thread():
|
||||
returned = func()
|
||||
|
|
Loading…
Reference in a new issue