fix(aurora): added addrole/removerole support to case_factory

This commit is contained in:
Seaswimmer 2024-05-03 21:42:02 -04:00
parent af108519f9
commit 1d1795c262
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -2,16 +2,12 @@
from datetime import datetime, timedelta from datetime import datetime, timedelta
from typing import Union from typing import Union
from discord import (Color, Embed, Guild, Interaction, InteractionMessage, from discord import Color, Embed, Guild, Interaction, InteractionMessage, Member, Role, User
Member, Role, User)
from redbot.core import commands from redbot.core import commands
from redbot.core.utils.chat_formatting import (bold, box, error, from redbot.core.utils.chat_formatting import bold, box, error, humanize_timedelta, warning
humanize_timedelta, warning)
from aurora.utilities.config import config from aurora.utilities.config import config
from aurora.utilities.utils import (fetch_channel_dict, fetch_user_dict, from aurora.utilities.utils import fetch_channel_dict, fetch_user_dict, get_bool_emoji, get_next_case_number, get_pagesize_str
get_bool_emoji, get_next_case_number,
get_pagesize_str)
async def message_factory( async def message_factory(
@ -273,6 +269,9 @@ async def case_factory(interaction: Interaction, case_dict: dict) -> Embed:
else "\n**Changes:** 0" else "\n**Changes:** 0"
) )
if case_dict["role_id"]:
embed.description += f"\n**Role:** <@&{case_dict['role_id']}>"
if case_dict["metadata"]: if case_dict["metadata"]:
if case_dict["metadata"]["imported_from"]: if case_dict["metadata"]["imported_from"]:
embed.description += ( embed.description += (