Added owner checks for source command

This commit is contained in:
2021-11-18 23:01:04 +01:00
parent 316f3bacc9
commit b8dc8b2b20
+5
View File
@@ -43,6 +43,7 @@ class SettingsCog(BaseCog, name="Settings"):
await AutoJoin.del_channel(ctx.redis, ctx.guild.id) await AutoJoin.del_channel(ctx.redis, ctx.guild.id)
await EmbedGenerator.Message(ctx, "Autojoin", "`disabled`") await EmbedGenerator.Message(ctx, "Autojoin", "`disabled`")
@commands.is_owner()
@commands.group( @commands.group(
name="source", name="source",
aliases=["src"], aliases=["src"],
@@ -57,6 +58,7 @@ class SettingsCog(BaseCog, name="Settings"):
embed.description = f"```{prefix}source list\n{prefix}source add <url>\n{prefix}source remove <url>\n{prefix}source sync```" embed.description = f"```{prefix}source list\n{prefix}source add <url>\n{prefix}source remove <url>\n{prefix}source sync```"
await ctx.send(embed=embed) await ctx.send(embed=embed)
@commands.is_owner()
@source.command(name="remove") @source.command(name="remove")
async def source_remove(self, ctx: CustomContext, source_url: str): async def source_remove(self, ctx: CustomContext, source_url: str):
"""Removes a source from the bot""" """Removes a source from the bot"""
@@ -74,6 +76,7 @@ class SettingsCog(BaseCog, name="Settings"):
embed.title = "Could not remove source, the specified source might not exist" embed.title = "Could not remove source, the specified source might not exist"
await ctx.send(embed=embed) await ctx.send(embed=embed)
@commands.is_owner()
@source.command(name="add") @source.command(name="add")
async def source_add(self, ctx: CustomContext, source_url: str): async def source_add(self, ctx: CustomContext, source_url: str):
""" """
@@ -109,6 +112,7 @@ class SettingsCog(BaseCog, name="Settings"):
else: else:
await ctx.send(embed=embed) await ctx.send(embed=embed)
@commands.is_owner()
@source.command(name="list", aliases=["ls"]) @source.command(name="list", aliases=["ls"])
async def source_list(self, ctx: CustomContext): async def source_list(self, ctx: CustomContext):
"""Display a list of sources""" """Display a list of sources"""
@@ -124,6 +128,7 @@ class SettingsCog(BaseCog, name="Settings"):
embed.description = description embed.description = description
await ctx.send(embed=embed) await ctx.send(embed=embed)
@commands.is_owner()
@source.command(name="sync") @source.command(name="sync")
async def source_sync(self, ctx: CustomContext): async def source_sync(self, ctx: CustomContext):
"""Forcefully resyncs all sources""" """Forcefully resyncs all sources"""