fix(aurora): added addrole/removerole support to case_factory
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 31s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 45s

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

View file

@ -2,16 +2,12 @@
from datetime import datetime, timedelta
from typing import Union
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,
humanize_timedelta, warning)
from redbot.core.utils.chat_formatting import bold, box, error, humanize_timedelta, 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(
@ -273,6 +269,9 @@ async def case_factory(interaction: Interaction, case_dict: dict) -> Embed:
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"]["imported_from"]:
embed.description += (