Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
🔨Fixed Blacklisted field on userinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
mmattbtw committed Jul 16, 2021
1 parent b8c8060 commit cd8cc3b
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions lib/cogs/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
config = json.load(config_file)

absolute_path = os.path.dirname(os.path.abspath(__file__))
# Or: file_path = os.path.join(absolute_path, 'folder', 'my_file.py')


def get_path(filename):
return absolute_path + f"/{filename}.json"
Expand Down Expand Up @@ -131,20 +129,13 @@ async def user_info_command(self, ctx, target: Optional[Member]):
if pledger == target:
member = pledger

blacklisted = target.id in BLACKLISTED_USERS["blacklist"]
if target in homeGuild.members and patreonRole in member.roles:
patreon_status = True
blacklisted = target.id in BLACKLISTED_USERS["blacklist"]
await self.user_info(ctx, target, patreon_status, blacklisted)

elif (
target.id in BLACKLISTED_USERS["blacklist"]
and target not in homeGuild.members
):
blacklisted = True
await self.user_info(ctx, target, False, blacklisted)

else:
await self.user_info(ctx, target, patreon_status=False, blacklisted=False)
await self.user_info(ctx, target, patreon_status=False, blacklisted=blacklisted)

@cog_ext.cog_slash(
name="userinfo",
Expand All @@ -170,20 +161,13 @@ async def user_info_slash(self, ctx, target: Optional[Member]):
if pledger == target:
member = pledger

blacklisted = target.id in BLACKLISTED_USERS["blacklist"]
if target in homeGuild.members and patreonRole in member.roles:
patreon_status = True
blacklisted = target.id in BLACKLISTED_USERS["blacklist"]
await self.user_info(ctx, target, patreon_status, blacklisted)

elif (
target.id in BLACKLISTED_USERS["blacklist"]
and target not in homeGuild.members
):
blacklisted = True
await self.user_info(ctx, target, False, blacklisted)

else:
await self.user_info(ctx, target, patreon_status=False, blacklisted=False)
await self.user_info(ctx, target, patreon_status=False, blacklisted=blacklisted)

async def server_info(self, ctx, banned_members):
embed = Embed(
Expand Down

0 comments on commit cd8cc3b

Please sign in to comment.