flask-develop
bobloy 6 years ago
parent beb5f125e4
commit e50901edc4

@ -25,6 +25,7 @@ class Flag:
self.config.register_guild(**default_guild) self.config.register_guild(**default_guild)
@checks.is_owner() @checks.is_owner()
@commands.guild_only()
@commands.command() @commands.command()
async def clearallflag(self, ctx: commands.Context): async def clearallflag(self, ctx: commands.Context):
"""Clears all flags for all members in this server""" """Clears all flags for all members in this server"""
@ -70,7 +71,7 @@ class Flag:
'expireday': 0 'expireday': 0
} }
# ************************Flag command group start************************ @commands.guild_only()
@checks.mod_or_permissions(manage_roles=True) @checks.mod_or_permissions(manage_roles=True)
@commands.command() @commands.command()
async def flag(self, ctx: commands.Context, member: discord.Member, *, reason): async def flag(self, ctx: commands.Context, member: discord.Member, *, reason):
@ -107,8 +108,9 @@ class Flag:
else: else:
await ctx.send("This member has no flags.. somehow..") await ctx.send("This member has no flags.. somehow..")
@commands.guild_only()
@checks.mod_or_permissions(manage_roles=True) @checks.mod_or_permissions(manage_roles=True)
@commands.command(pass_context=True, no_pm=True, aliases=['flagclear']) @commands.command(aliases=['flagclear'])
async def clearflag(self, ctx: commands.Context, member: discord.Member): async def clearflag(self, ctx: commands.Context, member: discord.Member):
"""Clears flags for a member""" """Clears flags for a member"""
guild = ctx.guild guild = ctx.guild
@ -118,7 +120,8 @@ class Flag:
await ctx.send("Success!") await ctx.send("Success!")
@commands.command(pass_context=True, no_pm=True, aliases=['flaglist']) @commands.guild_only()
@commands.command(aliases=['flaglist'])
async def listflag(self, ctx: commands.Context, member: discord.Member): async def listflag(self, ctx: commands.Context, member: discord.Member):
"""Lists flags for a member""" """Lists flags for a member"""
server = ctx.guild server = ctx.guild
@ -131,7 +134,8 @@ class Flag:
else: else:
await ctx.send("This member has no flags!") await ctx.send("This member has no flags!")
@commands.command(pass_context=True, no_pm=True, aliases=['flagall']) @commands.guild_only()
@commands.command(aliases=['flagall'])
async def allflag(self, ctx: commands.Context): async def allflag(self, ctx: commands.Context):
"""Lists all flags for the server""" """Lists all flags for the server"""
guild = ctx.guild guild = ctx.guild

Loading…
Cancel
Save