Rename AsyncStream.on_disconnect to on_disconnect_message
authorHarmon <Harmon758@gmail.com>
Tue, 26 Jan 2021 13:44:37 +0000 (07:44 -0600)
committerHarmon <Harmon758@gmail.com>
Tue, 26 Jan 2021 13:44:37 +0000 (07:44 -0600)
Change references of disconnect notice to message

tweepy/asynchronous/streaming.py

index 9a07c1fb08b18fc10e075df38dffc9d4d310b96b..3cc3d8db012c4517bf606592be010b0da1544720 100644 (file)
@@ -292,8 +292,8 @@ class AsyncStream:
             return await self.on_delete(delete["id"], delete["user_id"])
         if "limit" in data:
             return await self.on_limit(data["limit"]["track"])
-        for message_type in ("disconnect", "scrub_geo", "status_withheld",
-                             "user_withheld", "warning"):
+        for message_type in ("disconnect_message", "scrub_geo",
+                             "status_withheld", "user_withheld", "warning"):
             if message_type in data:
                 method = getattr(self, "on_" + message_type)
                 return await method(data[message_type])
@@ -314,12 +314,12 @@ class AsyncStream:
         """
         log.debug("Received status deletion notice: %d", status_id)
 
-    async def on_disconnect(self, notice):
+    async def on_disconnect_message(self, message):
         """This method is a coroutine.
 
-        This is called when a disconnect notice is received.
+        This is called when a disconnect message is received.
         """
-        log.warning("Received disconnect message: %s", notice)
+        log.warning("Received disconnect message: %s", message)
 
     async def on_limit(self, track):
         """This method is a coroutine.