Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions plugins/clopen.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,16 +871,10 @@ 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):
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,
)
else:
if channel.state == ChannelState.USED:
await make_pending(session, channel)
# if the channel is already pending, make no changes
elif channel.state != ChannelState.PENDING:
channel.owner_id = None
await session.commit()

Expand Down