Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
🔧Fixed blacklisting
Browse files Browse the repository at this point in the history
  • Loading branch information
mmattbtw committed Aug 4, 2021
1 parent 23fe786 commit 96a8d6b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self):
)

self.token = os.environ.get("SPOTIFY_AUTH")
self.version = "1.2.5.fix"
self.version = "1.2.6"

async def event_ready(self):
print("\n" * 100)
Expand Down Expand Up @@ -114,6 +114,7 @@ def is_owner(self, ctx):

@commands.command(name="blacklistuser")
async def blacklist_user(self, ctx, *, user: str):
user = user.lower()
if ctx.author.is_mod or self.is_owner(ctx):
file = self.read_json("blacklist_user")
if user not in file["users"]:
Expand All @@ -127,6 +128,7 @@ async def blacklist_user(self, ctx, *, user: str):

@commands.command(name="unblacklistuser")
async def unblacklist_user(self, ctx, *, user: str):
user = user.lower()
if ctx.author.is_mod or self.is_owner(ctx):
file = self.read_json("blacklist_user")
if user in file["users"]:
Expand Down Expand Up @@ -261,7 +263,7 @@ async def songrequest_command(self, ctx, *, song: str):

async def song_request(self, ctx, song, song_uri, album: bool):
blacklisted_users = self.read_json("blacklist_user")["users"]
if ctx.author.name in blacklisted_users:
if ctx.author.name.lower() in blacklisted_users:
await ctx.send("You are blacklisted from requesting songs.")
else:
jscon = self.read_json("blacklist")
Expand Down

0 comments on commit 96a8d6b

Please sign in to comment.