Use the commands module instead of checks for permission decorators (#5463)

Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
This commit is contained in:
Kreusada
2023-04-13 19:16:12 +01:00
committed by GitHub
parent a70f444255
commit 79d11e947c
35 changed files with 238 additions and 249 deletions

View File

@@ -6,7 +6,7 @@ from copy import copy
import contextlib
import discord
from redbot.core import Config, checks, commands
from redbot.core import Config, commands
from redbot.core.utils import AsyncIter
from redbot.core.utils.chat_formatting import pagify, box
from redbot.core.utils.antispam import AntiSpam
@@ -97,14 +97,14 @@ class Reports(commands.Cog):
def tunnels(self):
return [x["tun"] for x in self.tunnel_store.values()]
@checks.admin_or_permissions(manage_guild=True)
@commands.admin_or_permissions(manage_guild=True)
@commands.guild_only()
@commands.group(name="reportset")
async def reportset(self, ctx: commands.Context):
"""Manage Reports."""
pass
@checks.admin_or_permissions(manage_guild=True)
@commands.admin_or_permissions(manage_guild=True)
@reportset.command(name="output")
async def reportset_output(
self, ctx: commands.Context, channel: Union[discord.TextChannel, discord.VoiceChannel]
@@ -113,7 +113,7 @@ class Reports(commands.Cog):
await self.config.guild(ctx.guild).output_channel.set(channel.id)
await ctx.send(_("The report channel has been set."))
@checks.admin_or_permissions(manage_guild=True)
@commands.admin_or_permissions(manage_guild=True)
@reportset.command(name="toggle", aliases=["toggleactive"])
async def reportset_toggle(self, ctx: commands.Context):
"""Enable or disable reporting for this server."""
@@ -388,7 +388,7 @@ class Reports(commands.Cog):
)
@commands.guild_only()
@checks.mod_or_permissions(manage_roles=True)
@commands.mod_or_permissions(manage_roles=True)
@report.command(name="interact")
async def response(self, ctx, ticket_number: int):
"""Open a message tunnel.