mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-23 21:47:04 +01:00
Add defaultchannel query parameter to embed to set default embed channel
This commit is contained in:
parent
0a18bec418
commit
9c5abd9b54
@ -273,16 +273,32 @@
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user