about summary refs log tree commit diff stats
path: root/discord/utils/event_emitter.py
diff options
context:
space:
mode:
authormjk134 <57556877+mjk134@users.noreply.github.com>2022-07-11 20:03:24 +0000
committerGitHub <noreply@github.com>2022-07-11 20:03:24 +0000
commitde4b806a7e5b823680acae4627607198cf1f59a6 (patch)
treee1db0047b5db098eafd930a39091645232edce8a /discord/utils/event_emitter.py
parentb271f3b37c9a28ba9254f2a24c98cfcd65cb3c24 (diff)
parent6576d95f3601613fc03232b106f1cdeda1d99e06 (diff)
downloaddiscobra-de4b806a7e5b823680acae4627607198cf1f59a6.tar.gz
Merge branch 'master' of https://github.com/mounderfod/discobra
Diffstat (limited to 'discord/utils/event_emitter.py')
-rw-r--r--discord/utils/event_emitter.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/discord/utils/event_emitter.py b/discord/utils/event_emitter.py
index 08b6060..7911326 100644
--- a/discord/utils/event_emitter.py
+++ b/discord/utils/event_emitter.py
@@ -1,18 +1,19 @@
 import asyncio
 from typing import Optional, Coroutine, Any, Callable, Dict
 
-class EventEmitter():
-    def __init__(self, loop: Optional[asyncio.AbstractEventLoop]=None):
+
+class EventEmitter:
+    def __init__(self, loop: Optional[asyncio.AbstractEventLoop] = None):
         self.listeners: Dict[str, Optional[Callable[..., Coroutine[Any, Any, Any]]]] = {}
         self.loop = loop if loop else asyncio.get_event_loop()
 
-    def add_listener(self, event_name: str, func: Optional[Callable[..., Coroutine[Any, Any, Any]]]=None):
+    def add_listener(self, event_name: str, func: Optional[Callable[..., Coroutine[Any, Any, Any]]] = None):
         if not self.listeners.get(event_name, None):
             self.listeners[event_name] = {func}
         else:
             self.listeners[event_name].add(func)
 
-    def remove_listener(self, event_name: str, func: Optional[Callable[..., Coroutine[Any, Any, Any]]]=None):
+    def remove_listener(self, event_name: str, func: Optional[Callable[..., Coroutine[Any, Any, Any]]] = None):
         self.listeners[event_name].remove(func)
         if len(self.listeners[event_name]) == 0:
             del self.listeners[event_name]