mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-04 07:47:10 +01:00 
			
		
		
		
	Fix channel update not responding
This commit is contained in:
		@@ -162,7 +162,7 @@ class Titan(discord.AutoShardedClient):
 | 
				
			|||||||
            await self.database.update_guild(channel.guild)
 | 
					            await self.database.update_guild(channel.guild)
 | 
				
			||||||
            await self.socketio.on_channel_create(channel)
 | 
					            await self.socketio.on_channel_create(channel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async def on_channel_update(self, channelbefore, channelafter):
 | 
					    async def on_guild_channel_update(self, channelbefore, channelafter):
 | 
				
			||||||
        await self.database.update_guild(channelafter.guild)
 | 
					        await self.database.update_guild(channelafter.guild)
 | 
				
			||||||
        await self.socketio.on_channel_update(channelafter)
 | 
					        await self.socketio.on_channel_update(channelafter)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@ import socketio
 | 
				
			|||||||
from titanembeds.utils import get_message_author, get_message_mentions, get_roles_list, get_attachments_list, get_embeds_list
 | 
					from titanembeds.utils import get_message_author, get_message_mentions, get_roles_list, get_attachments_list, get_embeds_list
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
from email import utils as emailutils
 | 
					from email import utils as emailutils
 | 
				
			||||||
 | 
					import discord
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SocketIOInterface:
 | 
					class SocketIOInterface:
 | 
				
			||||||
    def __init__(self, bot, redis_uri):
 | 
					    def __init__(self, bot, redis_uri):
 | 
				
			||||||
@@ -155,7 +156,7 @@ class SocketIOInterface:
 | 
				
			|||||||
        await self.io.emit('CHANNEL_CREATE', data=chan, room=str("GUILD_"+str(channel.guild.id)), namespace='/gateway')
 | 
					        await self.io.emit('CHANNEL_CREATE', data=chan, room=str("GUILD_"+str(channel.guild.id)), namespace='/gateway')
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    async def on_channel_update(self, channel):
 | 
					    async def on_channel_update(self, channel):
 | 
				
			||||||
        if str(channel.type) not in ["text", "category"]:
 | 
					        if not isinstance(channel, discord.channel.TextChannel) and not isinstance(channel, discord.channel.CategoryChannel):
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        chan = self.get_formatted_channel(channel)
 | 
					        chan = self.get_formatted_channel(channel)
 | 
				
			||||||
        await self.io.emit('CHANNEL_UPDATE', data=chan, room=str("GUILD_"+str(channel.guild.id)), namespace='/gateway')
 | 
					        await self.io.emit('CHANNEL_UPDATE', data=chan, room=str("GUILD_"+str(channel.guild.id)), namespace='/gateway')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user