Compare commits

..

No commits in common. "84543fbd73386890c37f36734e723c249badbcd2" and "98396c17e29f0d0f6cb31710e5c5309fbb4f9978" have entirely different histories.

10 changed files with 26 additions and 32 deletions

View file

@ -1,4 +1,3 @@
# pylint: disable=duplicate-code
import json
from datetime import timedelta
from typing import Dict
@ -19,7 +18,7 @@ class ImportAuroraView(ui.View):
@ui.button(label="Yes", style=ButtonStyle.success)
async def import_button_y(
self, interaction: Interaction, button: ui.Button
): # pylint: disable=unused-argument
):
await self.message.delete()
await interaction.response.send_message(
"Deleting original table...", ephemeral=True
@ -108,7 +107,7 @@ class ImportAuroraView(ui.View):
@ui.button(label="No", style=ButtonStyle.danger)
async def import_button_n(
self, interaction: Interaction, button: ui.Button
): # pylint: disable=unused-argument
):
await self.message.edit(content="Import cancelled.", view=None)
await self.message.delete(10)
await self.ctx.message.delete(10)

View file

@ -1,4 +1,3 @@
# pylint: disable=duplicate-code
import json
from datetime import timedelta
@ -18,7 +17,7 @@ class ImportGalacticBotView(ui.View):
@ui.button(label="Yes", style=ButtonStyle.success)
async def import_button_y(
self, interaction: Interaction, button: ui.Button
): # pylint: disable=unused-argument
):
await self.message.delete()
await interaction.response.send_message(
"Deleting original table...", ephemeral=True
@ -151,7 +150,7 @@ class ImportGalacticBotView(ui.View):
@ui.button(label="No", style=ButtonStyle.danger)
async def import_button_n(
self, interaction: Interaction, button: ui.Button
): # pylint: disable=unused-argument
):
await self.message.edit(content="Import cancelled.", view=None)
await self.message.delete(10)
await self.ctx.message.delete(10)

View file

@ -6,6 +6,7 @@ from aurora.utilities.config import config
from aurora.utilities.factory import addrole_embed
class Addrole(ui.View):
def __init__(self, ctx: commands.Context):
super().__init__()
@ -26,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
@ -35,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

View file

@ -6,13 +6,14 @@ from aurora.utilities.factory import guild_embed
from aurora.utilities.utils import create_pagesize_options
class Guild(ui.View):
def __init__(self, ctx: commands.Context):
super().__init__()
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
@ -22,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
@ -32,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
@ -42,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
@ -52,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
@ -62,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
@ -72,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
@ -82,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

View file

@ -6,6 +6,7 @@ from aurora.utilities.config import config
from aurora.utilities.factory import immune_embed
class Immune(ui.View):
def __init__(self, ctx: commands.Context):
super().__init__()
@ -27,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
@ -36,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

View file

@ -6,13 +6,14 @@ from aurora.utilities.factory import overrides_embed
from aurora.utilities.utils import create_pagesize_options
class Overrides(ui.View):
def __init__(self, ctx: commands.Context):
super().__init__()
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
@ -27,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
@ -42,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

View file

@ -1,4 +1,3 @@
# pylint: disable=cyclic-import
import json
import sqlite3
import time
@ -120,7 +119,7 @@ async def mysql_log(
expired: bool = None,
changes: list = [],
metadata: dict = {},
) -> int: # pylint: disable=dangerous-default-value
) -> int:
if not timestamp:
timestamp = int(time.time())

View file

@ -1,17 +1,13 @@
# pylint: disable=cyclic-import
from datetime import datetime, timedelta
from typing import Union
import humanize
from discord import (Color, Embed, Guild, Interaction, InteractionMessage,
Member, Role, User)
from discord import Color, Embed, Guild, Interaction, InteractionMessage, Member, Role, User
from redbot.core import commands
from redbot.core.utils.chat_formatting import bold, box, error, warning
from aurora.utilities.config import config
from aurora.utilities.utils import (fetch_channel_dict, fetch_user_dict,
get_bool_emoji, get_next_case_number,
get_pagesize_str)
from aurora.utilities.utils import fetch_channel_dict, fetch_user_dict, get_bool_emoji, get_next_case_number, get_pagesize_str
async def message_factory(

View file

@ -1,4 +1,3 @@
# pylint: disable=cyclic-import
import json
from datetime import timedelta as td
from typing import Union

View file

@ -17,8 +17,6 @@ from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import error, text_to_file
# pylint: disable=protected-access
class Backup(commands.Cog):
"""A utility to make reinstalling repositories and cogs after migrating the bot far easier."""