mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
Use actual discord invites
This commit is contained in:
parent
cd3864a6a4
commit
566a4d4be1
@ -232,8 +232,7 @@ def filter_guild_channel(guild_id, channel_id):
|
|||||||
return chan
|
return chan
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_online_discord_users(guild_id):
|
def get_online_discord_users(guild_id, embed):
|
||||||
embed = discord_api.get_widget(guild_id)
|
|
||||||
apimembers = list_all_guild_members(guild_id)
|
apimembers = list_all_guild_members(guild_id)
|
||||||
apimembers_filtered = {}
|
apimembers_filtered = {}
|
||||||
for member in apimembers:
|
for member in apimembers:
|
||||||
@ -379,10 +378,11 @@ def query_guild():
|
|||||||
guild_id = request.args.get('guild_id')
|
guild_id = request.args.get('guild_id')
|
||||||
if check_guild_existance(guild_id):
|
if check_guild_existance(guild_id):
|
||||||
if check_user_in_guild(guild_id):
|
if check_user_in_guild(guild_id):
|
||||||
|
widget = discord_api.get_widget(guild_id)
|
||||||
channels = get_guild_channels(guild_id)
|
channels = get_guild_channels(guild_id)
|
||||||
discordmembers = get_online_discord_users(guild_id)
|
discordmembers = get_online_discord_users(guild_id, widget)
|
||||||
embedmembers = get_online_embed_users(guild_id)
|
embedmembers = get_online_embed_users(guild_id)
|
||||||
return jsonify(channels=channels, discordmembers=discordmembers, embedmembers=embedmembers)
|
return jsonify(channels=channels, discordmembers=discordmembers, embedmembers=embedmembers, instant_invite=widget.get("instant_invite"))
|
||||||
abort(403)
|
abort(403)
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
|
@ -163,6 +163,7 @@
|
|||||||
fill_discord_members(guildobj.discordmembers);
|
fill_discord_members(guildobj.discordmembers);
|
||||||
fill_authenticated_users(guildobj.embedmembers.authenticated);
|
fill_authenticated_users(guildobj.embedmembers.authenticated);
|
||||||
fill_unauthenticated_users(guildobj.embedmembers.unauthenticated);
|
fill_unauthenticated_users(guildobj.embedmembers.unauthenticated);
|
||||||
|
$("#instant-inv").attr("href", guildobj.instant_invite);
|
||||||
run_fetch_routine();
|
run_fetch_routine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,6 +462,7 @@
|
|||||||
fill_discord_members(guildobj.discordmembers);
|
fill_discord_members(guildobj.discordmembers);
|
||||||
fill_authenticated_users(guildobj.embedmembers.authenticated);
|
fill_authenticated_users(guildobj.embedmembers.authenticated);
|
||||||
fill_unauthenticated_users(guildobj.embedmembers.unauthenticated);
|
fill_unauthenticated_users(guildobj.embedmembers.unauthenticated);
|
||||||
|
$("#instant-inv").attr("href", guildobj.instant_invite);
|
||||||
fetchtimeout = setTimeout(run_fetch_routine, 5000);
|
fetchtimeout = setTimeout(run_fetch_routine, 5000);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
<li><a class="subheader">Actions</a></li>
|
<li><a class="subheader">Actions</a></li>
|
||||||
<li><a href="{{ url_for("user.administrate_guild", guild_id=guild['id']) }}" class="waves-effect" target="_blank" id="administrate_link" style="display: none;">Manage Guild Embed</a></li>
|
<li><a href="{{ url_for("user.administrate_guild", guild_id=guild['id']) }}" class="waves-effect" target="_blank" id="administrate_link" style="display: none;">Manage Guild Embed</a></li>
|
||||||
<li><a href="https://discordapp.com/channels/{{ guild['id'] }}/" class="waves-effect" target="_blank">Open Server on Discordapp</a></li>
|
<li><a id="instant-inv" href="#" class="waves-effect" target="_blank">Open Server on Discordapp</a></li>
|
||||||
|
|
||||||
<li><div class="divider"></div></li>
|
<li><div class="divider"></div></li>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user