diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 38288c1..f75653c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -20,9 +20,9 @@ jobs: uses: actions/checkout@v2 - name: Install Python Dependencies - uses: HassanAbouelela/actions/setup-python@setup-python_v1.3.2 + uses: HassanAbouelela/actions/setup-python@setup-python_v1.6.0 with: - dev: true + install_args: --no-root python_version: '3.9' # We will not run `flake8` here, as we will use a separate flake8 @@ -39,5 +39,6 @@ jobs: # Format used: # ::error file={filename},line={line},col={col}::{message} - name: Run flake8 - run: "flake8 \ - --format='::error file=%(path)s,line=%(row)d,col=%(col)d::[flake8] %(code)s: %(text)s'" + run: | + flake8 \ + --format='::error file=%(path)s,line=%(row)d,col=%(col)d::[flake8] %(code)s: %(text)s' diff --git a/ban_appeals/ban_appeals.py b/ban_appeals/ban_appeals.py index 183eedb..7102f5f 100644 --- a/ban_appeals/ban_appeals.py +++ b/ban_appeals/ban_appeals.py @@ -157,20 +157,23 @@ async def _handle_join(self, member: discord.Member) -> None: if not thread: return - category = await self.get_useable_appeal_category() + description = "The recipient has joined the appeals server." + if thread.channel.category.id not in self.appeal_categories: + category = await self.get_useable_appeal_category() + description = f"Thread moved to `{category}` category since recipient has joined the appeals server." + await thread.channel.move( + category=category, + end=True, + sync_permissions=True, + reason=f"{member} joined appeals server.", + ) + embed = discord.Embed( - description=f"Moving thread to `{category}` category since recipient has joined the appeals server.", + description=description, color=self.bot.mod_color ) await thread.channel.send(embed=embed) - await thread.channel.move( - category=category, - end=True, - sync_permissions=True, - reason=f"{member} joined appeals server.", - ) - async def _handle_remove(self, member: discord.Member) -> None: """ Notify if a member who is appealing leaves the appeals guild. diff --git a/pyproject.toml b/pyproject.toml index b34aa48..f27de53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,7 @@ version = "1.0.0" description = "A collection of modmail plugins for the Python Discord community." authors = ["Python Discord "] license = "MIT" +package-mode = false [tool.poetry.dependencies] python = "3.9.*"