mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-03 23:37:09 +01:00 
			
		
		
		
	Add defaultchannel query parameter to embed to set default embed channel
This commit is contained in:
		@@ -273,17 +273,33 @@
 | 
			
		||||
        if (guildobj === undefined) {
 | 
			
		||||
            var guild = query_guild();
 | 
			
		||||
            guild.done(function(data) {
 | 
			
		||||
                switch_to_default_channel(data.channels);
 | 
			
		||||
                prepare_guild(data);
 | 
			
		||||
                $('#loginmodal').modal('close');
 | 
			
		||||
                unlock_login_fields();
 | 
			
		||||
            });
 | 
			
		||||
        } else {
 | 
			
		||||
            switch_to_default_channel(guildobj.channels);
 | 
			
		||||
            prepare_guild(guildobj);
 | 
			
		||||
            $('#loginmodal').modal('close');
 | 
			
		||||
            unlock_login_fields();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    function switch_to_default_channel(guildchannels) {
 | 
			
		||||
        var defaultChannel = getParameterByName("defaultchannel");
 | 
			
		||||
        if (!defaultChannel) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        for (var i = 0; i < guildchannels.length; i++) {
 | 
			
		||||
            if (guildchannels[i].channel.id == defaultChannel) {
 | 
			
		||||
                selected_channel = defaultChannel;
 | 
			
		||||
                debugger;
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function prepare_guild(guildobj) {
 | 
			
		||||
        emoji_store = guildobj.emojis;
 | 
			
		||||
        fill_channels(guildobj.channels);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user