Server¶
- class discord.ext.ipc.Server(bot, host='127.0.0.1', secret_key=None, standard_port=1025, multicast_port=20000, do_multicast=True, logger=None)¶
Bases:
objectThe inter-process communication server attached to the bot.
- Parameters:
bot (
Bot) – The bot instance.host (
str) – The server address (defaults to127.0.0.1).secret_key (
str| None) – The authentication key required from clients.standard_port (
int) – The port for the standard server (defaults to1025).multicast_port (
int) – The port for the multicast server (defaults to20000).do_multicast (
bool) – Whether multicasting is allowed (enabled by default).logger (
logging.Logger| None) – The logger used by the library.
- classmethod route(name=None, multicast=True)¶
Register a coroutine as an endpoint.
- Parameters:
name (
str| None) – The endpoint name. Defaults to the function name.multicast (
bool) – Whether the endpoint is available over multicast connections.
- Return type:
Callable[[Callable[...,Awaitable[Any]]],Callable[...,Awaitable[Any]]]
- async start()¶
Start the standard (and, if enabled, multicast) servers.
- Return type:
None
- async stop()¶
Shut down all running servers.
- Return type:
None