From e59fb35e7573275a4884fb9ef87e575eafd10e66 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sat, 20 May 2017 01:45:38 +0000 Subject: [PATCH] Fixes --- discordbot/titanembeds/bot.py | 8 +++++--- webapp/titanembeds/blueprints/user/user.py | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/discordbot/titanembeds/bot.py b/discordbot/titanembeds/bot.py index 2db2694..996f708 100644 --- a/discordbot/titanembeds/bot.py +++ b/discordbot/titanembeds/bot.py @@ -91,18 +91,20 @@ class Titan(discord.Client): await self.database.delete_message(message) async def on_server_join(self, guild): + await asyncio.sleep(1) if not guild.me.server_permissions.administrator: - self.leave_server(guild) + await self.leave_server(guild) + return await self.database.update_guild(guild) for channel in guild.channels: async for message in self.logs_from(channel, limit=50, reverse=True): await self.database.push_message(message) for member in guild.members: - update_guild_member(member, True, False) + await self.database.update_guild_member(member, True, False) banned = self.get_bans(guild) for ban in banned: - update_guild_member(ban, False, True) + await self.database.update_guild_member(ban, False, True) async def on_server_remove(self, guild): await self.database.remove_guild(guild) diff --git a/webapp/titanembeds/blueprints/user/user.py b/webapp/titanembeds/blueprints/user/user.py index fc14507..792fbfc 100644 --- a/webapp/titanembeds/blueprints/user/user.py +++ b/webapp/titanembeds/blueprints/user/user.py @@ -124,6 +124,7 @@ def update_administrate_guild(guild_id): @user.route("/add-bot/") @discord_users_only() def add_bot(guild_id): + session["redirect"] = None return render_template("add_bot.html.j2", guild_id=guild_id, guild_invite_url=generate_bot_invite_url(guild_id)) def prepare_guild_members_list(members, bans):