Vexed01 / Vex-Cogs

My cogs for Red.
https://cogdocs.vexcodes.com
GNU General Public License v3.0
28 stars 21 forks source link

[Status] Command to clear deleted channels #101

Closed Vexed01 closed 1 year ago

Vexed01 commented 2 years ago

What cog is this feature request for?

Status

Describe the feature request in as much detail as possible

Add a command to clear channels from Config that have been deleted. It should be owner only and tell them the total number removed.

I have made the simple code to delete the channels:

all_cs = await self.config.all_channels()

for c in all_cs:
  chan = bot.get_channel(c)
  if chan is None:
    await self.config.channel_from_id(c).clear()

A note should also be added to the unfindable channel log about the command's existance which notes that this could be caused by a deleted channel or not having a fully chunked bot. The TODO should be removed. Both are in this file: https://github.com/Vexed01/Vex-Cogs/blob/d06042d7cde41883aa6233b384cec055d96b3070/status/updateloop/utils.py#L62-L63