From e9edfa357e665e33ee4ae616cab74e59b3b7e454 Mon Sep 17 00:00:00 2001 From: mysistersbrother <70792267+mysistersbrother@users.noreply.github.com> Date: Sun, 30 Nov 2025 00:54:43 +1100 Subject: [PATCH 1/3] make channel pending rather than closing when original message is deleted --- plugins/clopen.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/plugins/clopen.py b/plugins/clopen.py index c190335..f4447dd 100644 --- a/plugins/clopen.py +++ b/plugins/clopen.py @@ -872,14 +872,7 @@ async def on_raw_message_delete(self, payload: RawMessageDeleteEvent) -> None: return async with channel_locks[payload.channel_id]: if channel.state in (ChannelState.USED, ChannelState.PENDING): - await close( - session, - channel, - "Channel closed due to the original message being deleted. \n" - "If you did not intend to do this, please **open a new help channel**, \n" - "as this action is irreversible, and this channel may abruptly lock.", - reopen=False, - ) + await make_pending(session, channel) else: channel.owner_id = None await session.commit() From 7aef04a4057c8c47ca5610064e0d86a7500772b5 Mon Sep 17 00:00:00 2001 From: mysistersbrother <70792267+mysistersbrother@users.noreply.github.com> Date: Sun, 30 Nov 2025 01:45:52 +1100 Subject: [PATCH 2/3] no me pending --- plugins/clopen.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/clopen.py b/plugins/clopen.py index f4447dd..1c19ef3 100644 --- a/plugins/clopen.py +++ b/plugins/clopen.py @@ -871,8 +871,11 @@ async def on_raw_message_delete(self, payload: RawMessageDeleteEvent) -> None: if payload.message_id != channel.op_id: return async with channel_locks[payload.channel_id]: - if channel.state in (ChannelState.USED, ChannelState.PENDING): + if channel.state == ChannelState.USED: await make_pending(session, channel) + elif channel.state == ChannelState.PENDING: + # if the channel is already pending, make no changes + pass else: channel.owner_id = None await session.commit() From f7c40b0c7a9b6d396dbf4be37a76457df6e823c4 Mon Sep 17 00:00:00 2001 From: mysistersbrother <70792267+mysistersbrother@users.noreply.github.com> Date: Sun, 30 Nov 2025 01:46:57 +1100 Subject: [PATCH 3/3] this probs better --- plugins/clopen.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/clopen.py b/plugins/clopen.py index 1c19ef3..a90d563 100644 --- a/plugins/clopen.py +++ b/plugins/clopen.py @@ -873,10 +873,8 @@ async def on_raw_message_delete(self, payload: RawMessageDeleteEvent) -> None: async with channel_locks[payload.channel_id]: if channel.state == ChannelState.USED: await make_pending(session, channel) - elif channel.state == ChannelState.PENDING: - # if the channel is already pending, make no changes - pass - else: + # if the channel is already pending, make no changes + elif channel.state != ChannelState.PENDING: channel.owner_id = None await session.commit()