fix(aurora): fixed an AttributeError in the expiry handler

This commit is contained in:
Seaswimmer 2024-05-03 20:51:02 -04:00
parent 877f5e00d3
commit 7ef13016d9
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -13,12 +13,14 @@ from datetime import datetime, timedelta, timezone
from math import ceil from math import ceil
import discord import discord
from discord import Object
from discord.ext import tasks from discord.ext import tasks
from redbot.core import app_commands, commands, data_manager from redbot.core import app_commands, commands, data_manager
from redbot.core.app_commands import Choice from redbot.core.app_commands import Choice
from redbot.core.bot import Red from redbot.core.bot import Red
from redbot.core.commands.converter import parse_relativedelta, parse_timedelta from redbot.core.commands.converter import parse_relativedelta, parse_timedelta
from redbot.core.utils.chat_formatting import box, error, humanize_list, humanize_timedelta, warning from redbot.core.utils.chat_formatting import (box, error, humanize_list,
humanize_timedelta, warning)
from aurora.importers.aurora import ImportAuroraView from aurora.importers.aurora import ImportAuroraView
from aurora.importers.galacticbot import ImportGalacticBotView from aurora.importers.galacticbot import ImportGalacticBotView
@ -27,10 +29,18 @@ from aurora.menus.guild import Guild
from aurora.menus.immune import Immune from aurora.menus.immune import Immune
from aurora.menus.overrides import Overrides from aurora.menus.overrides import Overrides
from aurora.utilities.config import config, register_config from aurora.utilities.config import config, register_config
from aurora.utilities.database import connect, create_guild_table, fetch_case, mysql_log from aurora.utilities.database import (connect, create_guild_table, fetch_case,
from aurora.utilities.factory import addrole_embed, case_factory, changes_factory, evidenceformat_factory, guild_embed, immune_embed, message_factory, overrides_embed mysql_log)
from aurora.utilities.factory import (addrole_embed, case_factory,
changes_factory, evidenceformat_factory,
guild_embed, immune_embed,
message_factory, overrides_embed)
from aurora.utilities.logger import logger from aurora.utilities.logger import logger
from aurora.utilities.utils import check_moddable, check_permissions, convert_timedelta_to_str, fetch_channel_dict, fetch_user_dict, generate_dict, log, send_evidenceformat, timedelta_from_relativedelta from aurora.utilities.utils import (check_moddable, check_permissions,
convert_timedelta_to_str,
fetch_channel_dict, fetch_user_dict,
generate_dict, log, send_evidenceformat,
timedelta_from_relativedelta)
class Aurora(commands.Cog): class Aurora(commands.Cog):
@ -1695,7 +1705,7 @@ class Aurora(commands.Cog):
member = await guild.fetch_member(target_id) member = await guild.fetch_member(target_id)
await member.remove_roles( await member.remove_roles(
role_id, reason=f"Automatic role removal from case #{moderation_id}" roles=[Object(role_id)], reason=f"Automatic role removal from case #{moderation_id}"
) )
removerole_num = removerole_num + 1 removerole_num = removerole_num + 1
@ -1730,7 +1740,7 @@ class Aurora(commands.Cog):
member = await guild.fetch_member(target_id) member = await guild.fetch_member(target_id)
await member.add_roles( await member.add_roles(
role_id, reason=f"Automatic role addition from case #{moderation_id}" roles=[Object(role_id)], reason=f"Automatic role addition from case #{moderation_id}"
) )
addrole_num = addrole_num + 1 addrole_num = addrole_num + 1