Remove TypingStatus
This commit is contained in:
@@ -55,8 +55,6 @@ Miscellaneous
|
||||
.. autoclass:: ThreadLocation(Enum)
|
||||
:undoc-members:
|
||||
.. autoclass:: ActiveStatus()
|
||||
.. autoclass:: TypingStatus(Enum)
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: QuickReply
|
||||
.. autoclass:: QuickReplyText
|
||||
|
@@ -15,7 +15,7 @@ from ._core import Image
|
||||
from ._exception import FBchatException, FBchatFacebookError
|
||||
from ._session import Session
|
||||
from ._thread import ThreadLocation, ThreadABC, Thread
|
||||
from ._user import TypingStatus, User, UserData, ActiveStatus
|
||||
from ._user import User, UserData, ActiveStatus
|
||||
from ._group import Group, GroupData
|
||||
from ._page import Page, PageData
|
||||
from ._message import EmojiSize, Mention, Message
|
||||
|
@@ -7,7 +7,7 @@ from . import _util, _graphql, _session
|
||||
|
||||
from ._exception import FBchatException, FBchatFacebookError
|
||||
from ._thread import ThreadLocation
|
||||
from ._user import TypingStatus, User, UserData, ActiveStatus
|
||||
from ._user import User, UserData, ActiveStatus
|
||||
from ._group import Group, GroupData
|
||||
from ._page import Page, PageData
|
||||
from ._message import EmojiSize, Mention, Message
|
||||
@@ -1401,9 +1401,8 @@ class Client:
|
||||
else:
|
||||
thread_id = author_id
|
||||
thread = User(session=self.session, id=thread_id)
|
||||
typing_status = TypingStatus(m.get("st"))
|
||||
self.on_typing(
|
||||
author_id=author_id, status=typing_status, thread=thread,
|
||||
author_id=author_id, status=m["st"] == 1, thread=thread
|
||||
)
|
||||
|
||||
# Delivered
|
||||
@@ -1812,7 +1811,7 @@ class Client:
|
||||
|
||||
Args:
|
||||
author_id: The ID of the person who sent the action
|
||||
status (TypingStatus): The typing status
|
||||
is_typing: ``True`` if the user started typing, ``False`` if they stopped.
|
||||
thread: Thread that the action was sent to. See :ref:`intro_threads`
|
||||
"""
|
||||
pass
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import attr
|
||||
from ._core import log, attrs_default, Enum, Image
|
||||
from ._core import log, attrs_default, Image
|
||||
from . import _util, _session, _plan, _thread
|
||||
|
||||
|
||||
@@ -33,13 +33,6 @@ GENDERS = {
|
||||
}
|
||||
|
||||
|
||||
class TypingStatus(Enum):
|
||||
"""Used to specify whether the user is typing or has stopped typing."""
|
||||
|
||||
STOPPED = 0
|
||||
TYPING = 1
|
||||
|
||||
|
||||
@attrs_default
|
||||
class User(_thread.ThreadABC):
|
||||
"""Represents a Facebook user. Implements `ThreadABC`."""
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from fbchat import Message, FBchatFacebookError, TypingStatus
|
||||
from fbchat import Message, FBchatFacebookError
|
||||
from utils import random_hex, subset
|
||||
from os import path
|
||||
|
||||
@@ -105,7 +105,7 @@ def test_change_color_invalid(client):
|
||||
client.change_thread_color(InvalidColor())
|
||||
|
||||
|
||||
@pytest.mark.parametrize("status", TypingStatus)
|
||||
@pytest.mark.parametrize("status", [True, False])
|
||||
def test_typing_status(client, catch_event, compare, status):
|
||||
with catch_event("on_typing") as x:
|
||||
client.set_typing_status(status)
|
||||
|
Reference in New Issue
Block a user