mirror of
https://github.com/MelisaDev/melisa.git
synced 2024-11-11 19:07:28 +03:00
fix: shard imports
This commit is contained in:
parent
e539528e71
commit
725432162d
4 changed files with 20 additions and 14 deletions
|
@ -9,10 +9,10 @@ from .rest import RESTApp
|
|||
from .core.gateway import GatewayBotInfo
|
||||
from .models.guild.channel import Channel, ChannelType, channel_types_for_converting
|
||||
from .models import User, Guild, Activity
|
||||
from .models.app import Shard
|
||||
from .models.app.shard import Shard
|
||||
from .models.app.intents import Intents
|
||||
from .utils.snowflake import Snowflake
|
||||
from .utils import APIModelBase
|
||||
from .utils.api_model import APIModelBase
|
||||
from .utils.logging import init_logging
|
||||
from .utils.types import Coro
|
||||
from .utils.waiters import WaiterMgr
|
||||
|
|
|
@ -78,6 +78,7 @@ class Gateway:
|
|||
self.listeners = listeners
|
||||
|
||||
self._last_send = 0
|
||||
self._max_connect_retries = 5
|
||||
|
||||
self.auth = {
|
||||
"token": self.client._token,
|
||||
|
@ -100,8 +101,10 @@ class Gateway:
|
|||
self._buffer: bytearray = bytearray()
|
||||
|
||||
async def connect(self) -> None:
|
||||
try:
|
||||
self.ws = await self.__session.ws_connect(
|
||||
"wss://gateway.discord.gg/?v=10&encoding=json&compress=zlib-stream"
|
||||
"wss://gateway.discord.gg/?v=10&encoding=json&compress=zlib-stream",
|
||||
timeout=30.0
|
||||
)
|
||||
_logger.debug("(Shard %s) Starting...", self.shard_id)
|
||||
|
||||
|
@ -112,6 +115,10 @@ class Gateway:
|
|||
await self.send_identify()
|
||||
self.loop.create_task(self.receive())
|
||||
await self.check_heartbeating()
|
||||
except (aiohttp.ClientConnectionError, asyncio.TimeoutError) as exc:
|
||||
_logger.error("(Shard %s) Connecting failed!", self.shard_id)
|
||||
|
||||
raise exc
|
||||
|
||||
async def check_heartbeating(self):
|
||||
while self.not_closed:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright MelisaDev 2022 - Present
|
||||
# Full MIT License can be found in `LICENSE.txt` at the project root.
|
||||
|
||||
from .app import Shard, Intents
|
||||
from .app import Intents
|
||||
from .guild import *
|
||||
from .user import *
|
||||
from .message import *
|
||||
|
|
|
@ -2,4 +2,3 @@
|
|||
# Full MIT License can be found in `LICENSE.txt` at the project root.
|
||||
|
||||
from .intents import Intents
|
||||
from .shard import Shard
|
||||
|
|
Loading…
Reference in a new issue