Skip to content

fix(empty_voices): update temp_channels config after successful delete#153

Merged
psykzz merged 1 commit into
mainfrom
msmith-riot/issue-147-fix-temp-channel-tracking-on-failed-dele-7fa9af
May 27, 2026
Merged

fix(empty_voices): update temp_channels config after successful delete#153
psykzz merged 1 commit into
mainfrom
msmith-riot/issue-147-fix-temp-channel-tracking-on-failed-dele-7fa9af

Conversation

@psykzz

@psykzz psykzz commented May 27, 2026

Copy link
Copy Markdown
Owner

In try_delete_channel(), the channel ID was removed from temp_channels
config before channel.delete() was attempted. If the deletion raised
discord.Forbidden or discord.HTTPException, the channel remained alive in
Discord but was silently dropped from tracking -- meaning future cleanup and
validation passes would never see it.

Fix: move the config update to after channel.delete() returns
successfully. On any exception that leaves the channel alive (Forbidden,
HTTPException), the config is untouched and the channel stays tracked. The
NotFound case (channel already gone externally) is still cleaned up
correctly by the existing handler, which is also simplified to reuse the
already-fetched guild_group / temp_channels variables instead of
re-fetching inside a nested try/except.

Fixes: #147

Move the temp_channels config removal to after channel.delete() succeeds.
Previously, the channel ID was removed from config before deletion was
attempted, meaning a Forbidden or HTTPException would leave the channel
alive in Discord but untracked.

Simplify the NotFound handler to reuse the already-fetched guild_group
and temp_channels variables instead of re-fetching inside a nested
try/except.

Fixes #147

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@psykzz psykzz merged commit f62722b into main May 27, 2026
3 checks passed
@psykzz psykzz deleted the msmith-riot/issue-147-fix-temp-channel-tracking-on-failed-dele-7fa9af branch May 27, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix temp channel tracking on failed delete in empty_voices

1 participant