forked from blizzthewolf/SeaCogs
fix(repo): ruff fixes / removing pylint exceptions
This commit is contained in:
parent
e34d621e6d
commit
858a1bae8a
12 changed files with 51 additions and 56 deletions
|
@ -1,9 +1,11 @@
|
|||
from discord import ButtonStyle, ui, Interaction
|
||||
from discord import ButtonStyle, Interaction, ui
|
||||
from redbot.core import commands
|
||||
from redbot.core.utils.chat_formatting import error
|
||||
|
||||
from aurora.utilities.factory import addrole_embed
|
||||
from aurora.utilities.config import config
|
||||
from aurora.utilities.factory import addrole_embed
|
||||
|
||||
|
||||
|
||||
class Addrole(ui.View):
|
||||
def __init__(self, ctx: commands.Context):
|
||||
|
@ -25,7 +27,7 @@ class Addrole(ui.View):
|
|||
await interaction.message.edit(embed=await addrole_embed(self.ctx))
|
||||
|
||||
@ui.button(label="Clear", style=ButtonStyle.red, row=1)
|
||||
async def clear(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def clear(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message(error("You must have the manage guild permission to clear the guild's addrole whitelist."), ephemeral=True)
|
||||
return
|
||||
|
@ -34,7 +36,7 @@ class Addrole(ui.View):
|
|||
await interaction.message.edit(embed=await addrole_embed(self.ctx))
|
||||
|
||||
@ui.button(label="Close", style=ButtonStyle.gray)
|
||||
async def close(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def close(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message(error("You can't do that!"), ephemeral=True)
|
||||
return
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
from discord import ui, ButtonStyle, Interaction
|
||||
from discord import ButtonStyle, Interaction, ui
|
||||
from redbot.core import commands
|
||||
|
||||
from aurora.utilities.config import config
|
||||
from aurora.utilities.factory import guild_embed
|
||||
from aurora.utilities.utils import create_pagesize_options
|
||||
from aurora.utilities.config import config
|
||||
|
||||
|
||||
|
||||
class Guild(ui.View):
|
||||
def __init__(self, ctx: commands.Context):
|
||||
|
@ -11,7 +13,7 @@ class Guild(ui.View):
|
|||
self.ctx = ctx
|
||||
|
||||
@ui.button(label="Show Moderator", style=ButtonStyle.green, row=0)
|
||||
async def show_moderator(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def show_moderator(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message("You must have the manage guild permission to change this setting.", ephemeral=True)
|
||||
return
|
||||
|
@ -21,7 +23,7 @@ class Guild(ui.View):
|
|||
await interaction.message.edit(embed=await guild_embed(self.ctx))
|
||||
|
||||
@ui.button(label="Use Discord Permissions", style=ButtonStyle.green, row=0)
|
||||
async def use_discord_permissions(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def use_discord_permissions(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message("You must have the manage guild permission to change this setting.", ephemeral=True)
|
||||
return
|
||||
|
@ -31,7 +33,7 @@ class Guild(ui.View):
|
|||
await interaction.message.edit(embed=await guild_embed(self.ctx))
|
||||
|
||||
@ui.button(label="Ignore Modlog", style=ButtonStyle.green, row=0)
|
||||
async def ignore_modlog(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def ignore_modlog(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message("You must have the manage guild permission to change this setting.", ephemeral=True)
|
||||
return
|
||||
|
@ -41,7 +43,7 @@ class Guild(ui.View):
|
|||
await interaction.message.edit(embed=await guild_embed(self.ctx))
|
||||
|
||||
@ui.button(label="Ignore Other Bots", style=ButtonStyle.green, row=0)
|
||||
async def ignore_other_bots(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def ignore_other_bots(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message("You must have the manage guild permission to change this setting.", ephemeral=True)
|
||||
return
|
||||
|
@ -51,7 +53,7 @@ class Guild(ui.View):
|
|||
await interaction.message.edit(embed=await guild_embed(self.ctx))
|
||||
|
||||
@ui.button(label="DM Users", style=ButtonStyle.green, row=1)
|
||||
async def dm_users(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def dm_users(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message("You must have the manage guild permission to change this setting.", ephemeral=True)
|
||||
return
|
||||
|
@ -61,7 +63,7 @@ class Guild(ui.View):
|
|||
await interaction.message.edit(embed=await guild_embed(self.ctx))
|
||||
|
||||
@ui.button(label="Auto Evidence Format", style=ButtonStyle.green, row=1)
|
||||
async def auto_evidenceformat(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def auto_evidenceformat(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message("You must have the manage guild permission to change this setting.", ephemeral=True)
|
||||
return
|
||||
|
@ -71,7 +73,7 @@ class Guild(ui.View):
|
|||
await interaction.message.edit(embed=await guild_embed(self.ctx))
|
||||
|
||||
@ui.button(label="Ephemeral", style=ButtonStyle.green, row=1)
|
||||
async def ephemeral(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def ephemeral(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message("You must have the manage guild permission to change this setting.", ephemeral=True)
|
||||
return
|
||||
|
@ -81,7 +83,7 @@ class Guild(ui.View):
|
|||
await interaction.message.edit(embed=await guild_embed(self.ctx))
|
||||
|
||||
@ui.button(label="History Inline", style=ButtonStyle.green, row=1)
|
||||
async def inline(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def inline(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message("You must have the manage guild permission to change this setting.", ephemeral=True)
|
||||
return
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
from discord import ButtonStyle, ui, Interaction
|
||||
from discord import ButtonStyle, Interaction, ui
|
||||
from redbot.core import commands
|
||||
from redbot.core.utils.chat_formatting import error
|
||||
|
||||
from aurora.utilities.factory import immune_embed
|
||||
from aurora.utilities.config import config
|
||||
from aurora.utilities.factory import immune_embed
|
||||
|
||||
|
||||
|
||||
class Immune(ui.View):
|
||||
def __init__(self, ctx: commands.Context):
|
||||
|
@ -26,7 +28,7 @@ class Immune(ui.View):
|
|||
await interaction.message.edit(embed=await immune_embed(self.ctx))
|
||||
|
||||
@ui.button(label="Clear", style=ButtonStyle.red, row=1)
|
||||
async def clear(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def clear(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message(error("You must have the manage guild permission to clear the guild's immune roles."), ephemeral=True)
|
||||
return
|
||||
|
@ -35,7 +37,7 @@ class Immune(ui.View):
|
|||
await interaction.message.edit(embed=await immune_embed(self.ctx))
|
||||
|
||||
@ui.button(label="Close", style=ButtonStyle.gray)
|
||||
async def close(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def close(self, interaction: Interaction, button: ui.Button):
|
||||
if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message(error("You can't do that!"), ephemeral=True)
|
||||
return
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
from discord import ui, ButtonStyle, Interaction
|
||||
from discord import ButtonStyle, Interaction, ui
|
||||
from redbot.core import commands
|
||||
|
||||
from aurora.utilities.config import config
|
||||
from aurora.utilities.factory import overrides_embed
|
||||
from aurora.utilities.utils import create_pagesize_options
|
||||
from aurora.utilities.config import config
|
||||
|
||||
|
||||
|
||||
class Overrides(ui.View):
|
||||
def __init__(self, ctx: commands.Context):
|
||||
|
@ -11,7 +13,7 @@ class Overrides(ui.View):
|
|||
self.ctx = ctx
|
||||
|
||||
@ui.button(label="Auto Evidence Format", style=ButtonStyle.green, row=0)
|
||||
async def auto_evidenceformat(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def auto_evidenceformat(self, interaction: Interaction, button: ui.Button):
|
||||
if self.ctx.author != interaction.user:
|
||||
await interaction.response.send_message("You cannot change this setting for other users.", ephemeral=True)
|
||||
return
|
||||
|
@ -26,7 +28,7 @@ class Overrides(ui.View):
|
|||
await interaction.message.edit(embed=await overrides_embed(self.ctx))
|
||||
|
||||
@ui.button(label="Ephemeral", style=ButtonStyle.green, row=0)
|
||||
async def ephemeral(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def ephemeral(self, interaction: Interaction, button: ui.Button):
|
||||
if self.ctx.author != interaction.user:
|
||||
await interaction.response.send_message("You cannot change this setting for other users.", ephemeral=True)
|
||||
return
|
||||
|
@ -41,7 +43,7 @@ class Overrides(ui.View):
|
|||
await interaction.message.edit(embed=await overrides_embed(self.ctx))
|
||||
|
||||
@ui.button(label="Inline", style=ButtonStyle.green, row=0)
|
||||
async def inline(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||
async def inline(self, interaction: Interaction, button: ui.Button):
|
||||
if self.ctx.author != interaction.user:
|
||||
await interaction.response.send_message("You cannot change this setting for other users.", ephemeral=True)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue