Check if guild is None in can user see check
This commit is contained in:
parent
179c8a954b
commit
bdd0da38ab
@ -91,9 +91,7 @@ class QueryABC(ObjectType):
|
|||||||
|
|
||||||
for u in user.users:
|
for u in user.users:
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is not None and permissions.is_member_technician(guild.get_member(u.discord_id)):
|
||||||
return False
|
|
||||||
if permissions.is_member_technician(guild.get_member(u.discord_id)):
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if config.get_configuration(MAINTENANCE):
|
if config.get_configuration(MAINTENANCE):
|
||||||
@ -114,7 +112,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
|
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
|
||||||
access = True
|
access = True
|
||||||
@ -126,7 +124,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if permissions.is_member_moderator(member) and u.server.id == element.auto_role.server.id:
|
if permissions.is_member_moderator(member) and u.server.id == element.auto_role.server.id:
|
||||||
access = True
|
access = True
|
||||||
@ -144,7 +142,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if permissions.is_member_moderator(member):
|
if permissions.is_member_moderator(member):
|
||||||
access = True
|
access = True
|
||||||
@ -169,7 +167,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if u.id == element.id or permissions.is_member_moderator(member):
|
if u.id == element.id or permissions.is_member_moderator(member):
|
||||||
access = True
|
access = True
|
||||||
@ -180,7 +178,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if u.id == element.user.id or permissions.is_member_moderator(member):
|
if u.id == element.user.id or permissions.is_member_moderator(member):
|
||||||
access = True
|
access = True
|
||||||
@ -191,7 +189,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if u.id == element.user.id or permissions.is_member_moderator(member):
|
if u.id == element.user.id or permissions.is_member_moderator(member):
|
||||||
access = True
|
access = True
|
||||||
@ -202,7 +200,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if u.id == element.user.id or permissions.is_member_moderator(member):
|
if u.id == element.user.id or permissions.is_member_moderator(member):
|
||||||
access = True
|
access = True
|
||||||
@ -213,7 +211,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if u.id == element.user.id or permissions.is_member_moderator(member):
|
if u.id == element.user.id or permissions.is_member_moderator(member):
|
||||||
access = True
|
access = True
|
||||||
@ -224,7 +222,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if permissions.is_member_technician(member):
|
if permissions.is_member_technician(member):
|
||||||
access = True
|
access = True
|
||||||
@ -236,7 +234,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
|
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
|
||||||
access = True
|
access = True
|
||||||
@ -248,7 +246,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
|
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
|
||||||
access = True
|
access = True
|
||||||
@ -259,7 +257,7 @@ class QueryABC(ObjectType):
|
|||||||
u: User = u
|
u: User = u
|
||||||
guild = bot.get_guild(u.server.discord_id)
|
guild = bot.get_guild(u.server.discord_id)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
return False
|
continue
|
||||||
member = guild.get_member(u.discord_id)
|
member = guild.get_member(u.discord_id)
|
||||||
if permissions.is_member_technician(member):
|
if permissions.is_member_technician(member):
|
||||||
access = True
|
access = True
|
||||||
|
Loading…
Reference in New Issue
Block a user