Mock implementation of a discord.gateway.DiscordWebSocket. Overwrites a Client’s default websocket, allowing hooking of its methods to update the backend and provide callbacks.

class FakeWebSocket(*args: Any, **kwargs: Any)

A mock implementation of a DiscordWebSocket. Instead of actually sending information to discord, it simply triggers calls to the dpytest backend, as well as triggering runner callbacks.

__init__(*args: Any, **kwargs: Any)None

Initialize self. See help(type(self)) for accurate signature.

async send(data: Dict[str, Union[str, int, bool, Dict[str, JsonVal], List[JsonVal]]])None
async change_presence(*, activity: Optional[discord.BaseActivity] = None, status: Optional[str] = None, afk: bool = False, since: float = 0.0)None