mirror of https://gitlab.com/litecord/litecord.git
gateway: remove subscriptions with flags
This commit is contained in:
parent
33c7db9cbb
commit
0119044a6c
|
|
@ -56,8 +56,6 @@ from litecord.gateway.errors import (
|
||||||
)
|
)
|
||||||
from litecord.gateway.encoding import encode_json, decode_json, encode_etf, decode_etf
|
from litecord.gateway.encoding import encode_json, decode_json, encode_etf, decode_etf
|
||||||
from litecord.gateway.utils import WebsocketFileHandler
|
from litecord.gateway.utils import WebsocketFileHandler
|
||||||
from litecord.pubsub.guild import GuildFlags
|
|
||||||
from litecord.pubsub.channel import ChannelFlags
|
|
||||||
from litecord.gateway.schemas import (
|
from litecord.gateway.schemas import (
|
||||||
validate,
|
validate,
|
||||||
IDENTIFY_SCHEMA,
|
IDENTIFY_SCHEMA,
|
||||||
|
|
@ -508,11 +506,7 @@ class GatewayWebsocket:
|
||||||
channel_ids: List[int] = []
|
channel_ids: List[int] = []
|
||||||
|
|
||||||
for guild_id in guild_ids:
|
for guild_id in guild_ids:
|
||||||
await app.dispatcher.guild.sub_with_flags(
|
await app.dispatcher.guild.sub(guild_id, session_id)
|
||||||
guild_id,
|
|
||||||
session_id,
|
|
||||||
GuildFlags(presence=True, typing=True),
|
|
||||||
)
|
|
||||||
|
|
||||||
# instead of calculating which channels to subscribe to
|
# instead of calculating which channels to subscribe to
|
||||||
# inside guild dispatcher, we calculate them in here, so that
|
# inside guild dispatcher, we calculate them in here, so that
|
||||||
|
|
@ -529,9 +523,7 @@ class GatewayWebsocket:
|
||||||
|
|
||||||
log.info("subscribing to {} guild channels", len(channel_ids))
|
log.info("subscribing to {} guild channels", len(channel_ids))
|
||||||
for channel_id in channel_ids:
|
for channel_id in channel_ids:
|
||||||
await app.dispatcher.channel.sub_with_flags(
|
await app.dispatcher.channel.sub(channel_id, session_id)
|
||||||
channel_id, session_id, ChannelFlags(typing=True)
|
|
||||||
)
|
|
||||||
|
|
||||||
for dm_id in dm_ids:
|
for dm_id in dm_ids:
|
||||||
await app.dispatcher.channel.sub(dm_id, session_id)
|
await app.dispatcher.channel.sub(dm_id, session_id)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue