State

Mock implementation of a discord.state.ConnectionState. Overwrites a Client’s default state, allowing hooking of its methods and support for test-related features.

class FakeState(client: discord.Client, http: discord.http.HTTPClient, user: Optional[discord.ClientUser] = None, loop: Optional[asyncio.events.AbstractEventLoop] = None)

A mock implementation of a ConnectionState. Overrides methods that would otherwise cause issues, and implements functionality such as disabling dispatch temporarily.

http: back.FakeHttp
__init__(client: discord.Client, http: discord.http.HTTPClient, user: Optional[discord.ClientUser] = None, loop: Optional[asyncio.events.AbstractEventLoop] = None) None
stop_dispatch() None

Stop dispatching events to the client, if we are

start_dispatch() None

Start dispatching events to the client, if we aren’t already

async query_members(guild: discord.Guild, query: str, limit: int, user_ids: int, cache: bool, presences: bool) None
async chunk_guild(guild: discord.Guild, *, wait: bool = True, cache: Optional[bool] = None)