mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
Fixes
This commit is contained in:
parent
4be91675ff
commit
e59fb35e75
@ -91,18 +91,20 @@ class Titan(discord.Client):
|
|||||||
await self.database.delete_message(message)
|
await self.database.delete_message(message)
|
||||||
|
|
||||||
async def on_server_join(self, guild):
|
async def on_server_join(self, guild):
|
||||||
|
await asyncio.sleep(1)
|
||||||
if not guild.me.server_permissions.administrator:
|
if not guild.me.server_permissions.administrator:
|
||||||
self.leave_server(guild)
|
await self.leave_server(guild)
|
||||||
|
return
|
||||||
|
|
||||||
await self.database.update_guild(guild)
|
await self.database.update_guild(guild)
|
||||||
for channel in guild.channels:
|
for channel in guild.channels:
|
||||||
async for message in self.logs_from(channel, limit=50, reverse=True):
|
async for message in self.logs_from(channel, limit=50, reverse=True):
|
||||||
await self.database.push_message(message)
|
await self.database.push_message(message)
|
||||||
for member in guild.members:
|
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)
|
banned = self.get_bans(guild)
|
||||||
for ban in banned:
|
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):
|
async def on_server_remove(self, guild):
|
||||||
await self.database.remove_guild(guild)
|
await self.database.remove_guild(guild)
|
||||||
|
@ -124,6 +124,7 @@ def update_administrate_guild(guild_id):
|
|||||||
@user.route("/add-bot/<guild_id>")
|
@user.route("/add-bot/<guild_id>")
|
||||||
@discord_users_only()
|
@discord_users_only()
|
||||||
def add_bot(guild_id):
|
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))
|
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):
|
def prepare_guild_members_list(members, bans):
|
||||||
|
Loading…
Reference in New Issue
Block a user