feat: added owner checks to blacklist_add and blacklist_remove

This commit is contained in:
Seaswimmer 2023-08-02 01:07:57 -04:00
parent b2f4e9f3e5
commit 225c13ade9
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -186,6 +186,7 @@ class MusicDownloader(commands.Cog):
con.close() con.close()
@blacklist.command(name='add') @blacklist.command(name='add')
@checks.is_owner()
async def blacklist_add(self, ctx, user: discord.User, *, reason: str = None): async def blacklist_add(self, ctx, user: discord.User, *, reason: str = None):
data_path = str(data_manager.cog_data_path()) + f"{os.sep}MusicDownloader" data_path = str(data_manager.cog_data_path()) + f"{os.sep}MusicDownloader"
db_path = os.path.join(data_path, "database.db") db_path = os.path.join(data_path, "database.db")
@ -203,6 +204,7 @@ class MusicDownloader(commands.Cog):
await ctx.send(f"{user.mention} has been added to the blacklist with the reason: {reason or 'No reason provided.'}") await ctx.send(f"{user.mention} has been added to the blacklist with the reason: {reason or 'No reason provided.'}")
@blacklist.command(name='remove') @blacklist.command(name='remove')
@checks.is_owner()
async def blacklist_remove(self, ctx, user: discord.User): async def blacklist_remove(self, ctx, user: discord.User):
data_path = str(data_manager.cog_data_path()) + f"{os.sep}MusicDownloader{os.sep}Data" data_path = str(data_manager.cog_data_path()) + f"{os.sep}MusicDownloader{os.sep}Data"
db_path = os.path.join(data_path, "database.db") db_path = os.path.join(data_path, "database.db")