From d9f10801c70982269632e2e913bd60035f4b082e Mon Sep 17 00:00:00 2001 From: Ken-Miles <46692523+Ken-Miles@users.noreply.github.com> Date: Sat, 11 Feb 2023 11:08:25 -0600 Subject: [PATCH 1/3] Update dpy.py --- cogs/dpy.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogs/dpy.py b/cogs/dpy.py index b0b16bc0..ac5e7621 100644 --- a/cogs/dpy.py +++ b/cogs/dpy.py @@ -223,6 +223,9 @@ async def auto_archive_old_forum_threads(self): if thread.archived or thread.flags.pinned: continue + if thread.owner_id not in thread.members: # shouldnt need to check cache + await thread.edit(archived=True, reason='Auto-archived because OP left the thread.') + if thread.last_message_id is None: continue From a0c9b7faeb0dd797bcb7d20b997f8498ead131ef Mon Sep 17 00:00:00 2001 From: Ken-Miles <46692523+Ken-Miles@users.noreply.github.com> Date: Sat, 11 Feb 2023 11:15:00 -0600 Subject: [PATCH 2/3] accidentially put .owner_id instead of .owner --- cogs/dpy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/dpy.py b/cogs/dpy.py index ac5e7621..893b93b1 100644 --- a/cogs/dpy.py +++ b/cogs/dpy.py @@ -223,7 +223,7 @@ async def auto_archive_old_forum_threads(self): if thread.archived or thread.flags.pinned: continue - if thread.owner_id not in thread.members: # shouldnt need to check cache + if thread.owner not in thread.members: # shouldnt need to check cache await thread.edit(archived=True, reason='Auto-archived because OP left the thread.') if thread.last_message_id is None: From a381b5a1353ae8c739e97624f2b000c6fb98b675 Mon Sep 17 00:00:00 2001 From: Ken-Miles <46692523+Ken-Miles@users.noreply.github.com> Date: Sat, 11 Feb 2023 11:22:15 -0600 Subject: [PATCH 3/3] also checks if owner is None --- cogs/dpy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/dpy.py b/cogs/dpy.py index 893b93b1..2acccbbe 100644 --- a/cogs/dpy.py +++ b/cogs/dpy.py @@ -223,7 +223,7 @@ async def auto_archive_old_forum_threads(self): if thread.archived or thread.flags.pinned: continue - if thread.owner not in thread.members: # shouldnt need to check cache + if thread.owner not in thread.members or thread.owner is None: # shouldnt need to check cache await thread.edit(archived=True, reason='Auto-archived because OP left the thread.') if thread.last_message_id is None: