Fix owner permissions not doing properly

This commit is contained in:
Jeremy Zhang 2018-03-25 05:45:16 +00:00
parent e8424a63c8
commit 4859b5a379

View File

@ -213,7 +213,7 @@ def get_guild_channels(guild_id, force_everyone=False):
result_channels = []
for channel in guild_channels:
if channel['type'] in ["text", "category"]:
result = get_channel_permission(channel, guild_id, guild_owner, guild_roles, member_roles, session.get("user_id"), force_everyone)
result = get_channel_permission(channel, guild_id, guild_owner, guild_roles, member_roles, str(session.get("user_id")), force_everyone)
bot_result = get_channel_permission(channel, guild_id, guild_owner, guild_roles, bot_member_roles, config["client-id"], False)
if not bot_result["read"]:
result["read"] = False
@ -227,7 +227,7 @@ def get_guild_channels(guild_id, force_everyone=False):
def get_channel_permission(channel, guild_id, guild_owner, guild_roles, member_roles, user_id=None, force_everyone=False):
result = {"channel": channel, "read": False, "write": False, "mention_everyone": False}
if not user_id:
user_id = session.get("user_id")
user_id = str(session.get("user_id"))
if guild_owner == user_id:
result["read"] = True
result["write"] = True