mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2026-01-21 07:32:59 -05:00
Make some dependency changes, support Python 3.10 and 3.11 (#5611)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -64,14 +64,20 @@ class RPC:
|
||||
RPC server manager.
|
||||
"""
|
||||
|
||||
app: web.Application
|
||||
_rpc: RedRpc
|
||||
_runner: web.AppRunner
|
||||
|
||||
def __init__(self):
|
||||
self._site: Optional[web.TCPSite] = None
|
||||
self._started = False
|
||||
|
||||
async def _pre_login(self) -> None:
|
||||
self.app = web.Application()
|
||||
self._rpc = RedRpc()
|
||||
self.app.router.add_route("*", "/", self._rpc.handle_request)
|
||||
|
||||
self._runner = web.AppRunner(self.app)
|
||||
self._site: Optional[web.TCPSite] = None
|
||||
self._started = False
|
||||
|
||||
async def initialize(self, port: int):
|
||||
"""
|
||||
@@ -134,6 +140,9 @@ class RPCMixin:
|
||||
|
||||
self.rpc_handlers = {} # Uppercase cog name to method
|
||||
|
||||
async def _pre_login(self) -> None:
|
||||
await self.rpc._pre_login()
|
||||
|
||||
def register_rpc_handler(self, method):
|
||||
"""
|
||||
Registers a method to act as an RPC handler if the internal RPC server is active.
|
||||
|
||||
Reference in New Issue
Block a user