mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2025-06-16 11:25:22 +02:00
Initial support for channel categories
This commit is contained in:
@ -149,7 +149,7 @@ class SocketIOInterface:
|
||||
await self.io.emit('CHANNEL_CREATE', data=chan, room=str("GUILD_"+channel.server.id), namespace='/gateway')
|
||||
|
||||
async def on_channel_update(self, channel):
|
||||
if str(channel.type) != "text":
|
||||
if str(channel.type) not in ["text", "category"]:
|
||||
return
|
||||
chan = self.get_formatted_channel(channel)
|
||||
await self.io.emit('CHANNEL_UPDATE', data=chan, room=str("GUILD_"+channel.server.id), namespace='/gateway')
|
||||
|
@ -64,7 +64,7 @@ def get_roles_list(guildroles):
|
||||
def get_channels_list(guildchannels):
|
||||
channels = []
|
||||
for channel in guildchannels:
|
||||
if str(channel.type) == "text":
|
||||
if str(channel.type) in ["text", "category"]:
|
||||
overwrites = []
|
||||
for target, overwrite in channel.overwrites:
|
||||
if isinstance(target, discord.Role):
|
||||
@ -80,14 +80,17 @@ def get_channels_list(guildchannels):
|
||||
"allow": allow,
|
||||
"deny": deny,
|
||||
})
|
||||
|
||||
parent = channel.parent
|
||||
if parent:
|
||||
parent = parent.id
|
||||
channels.append({
|
||||
"id": channel.id,
|
||||
"name": channel.name,
|
||||
"topic": channel.topic,
|
||||
"position": channel.position,
|
||||
"type": str(channel.type),
|
||||
"permission_overwrites": overwrites
|
||||
"permission_overwrites": overwrites,
|
||||
"parent_id": parent,
|
||||
})
|
||||
return channels
|
||||
|
||||
|
Reference in New Issue
Block a user