


Template await fetch_guild ( guild_id, /, *, with_counts = True ) ¶Ĭlass discord. HTTPException – Getting the template failed. ParametersĬode (Union) – The Discord Template Code or URL (must be a discord.new URL). Gets a Template from a discord.new URL or code.

Guild – The guild with the guild data parsed. HTTPException – Getting the guilds failed. If the datetime is naive, it is assumed to be local time.Īfter (Union) – Retrieve guilds after this date or object. If a datetime is provided, it is recommended to use a UTC aware datetime. For moreĪdvanced users, this can be disabled by passing None toĬhanged in version 2.0: The default has been changed to 200.īefore (Union) – Retrieves guilds before this date or object. This function also sets up the logging library to make it easierįor beginners to know what is going on with the library. If you want more control over the event loop then thisįunction should not be used. , root_logger = False ) ¶Ī blocking call that abstracts away the event loop run ( token, *, reconnect = True, log_handler =. TypeError – An unexpected keyword argument was received. Invalid sharding payloads or bad tokens). ParametersĪnything as the library will do it for you. await start ( token, *, reconnect = True ) ¶Ī shorthand coroutine for login() + connect(). is_closed()Īnd is_ready() both return False along with the bot’s internalĬache cleared. clear ( ) ¶Īfter this, the bot can be considered “re-opened”, i.e. Is thrown then there is a Discord API outage.ĬonnectionClosed – The websocket connection has been terminated.Ĭloses the connection to Discord. GatewayNotFound – If the gateway to connect to Discord is not found. Certainĭisconnects that lead to bad state will not be handled (such as Reconnect ( bool) – If we should attempt reconnecting, either due to internetįailure or a specific failure on Discord’s part. Is not resumed until the WebSocket connection is terminated. This is a loop that runs the entireĮvent system and miscellaneous aspects of the library. Usually when it isn’t 200 or the known incorrect credentialsĬreates a websocket connection and lets the websocket listen HTTPException – An unknown HTTP related error occurred, LoginFailure – The wrong credentials are passed. Do not prefix this token withĪnything as the library will do it for you. Logs in the client with the specified credentials and

This class is used to interact with the Discord WebSocket and API. Represents a client connection that connects to Discord. The following section outlines the API of discord.py.Ĭlass discord.
