We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Mod cog sends owner notifications on fresh install.
# Other bugs

I got reminded about it when I saw a fix for #3587. Mod cog sends owner notifications about `[p]moveignoredchannels` and `[p]movedeletedelay` on fresh Red installs. Only viable solution seems to be looping through all guild settings and only send the message if `delete_delay` has been changed from the default in at least one of them though I'm basing that on my comment [here](https://github.com/Cog-Creators/Red-DiscordBot/pull/3638#discussion_r392119234).


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `redbot/cogs/mod/mod.py`
Content:
```
1 import asyncio
2 import logging
3 import re
4 from abc import ABC
5 from collections import defaultdict
6 from typing import List, Tuple
7 
8 import discord
9 from redbot.core import Config, modlog, commands
10 from redbot.core.bot import Red
11 from redbot.core.i18n import Translator, cog_i18n
12 from redbot.core.utils._internal_utils import send_to_owners_with_prefix_replaced
13 from .casetypes import CASETYPES
14 from .events import Events
15 from .kickban import KickBanMixin
16 from .mutes import MuteMixin
17 from .names import ModInfo
18 from .slowmode import Slowmode
19 from .settings import ModSettings
20 
21 _ = T_ = Translator("Mod", __file__)
22 
23 __version__ = "1.2.0"
24 
25 
26 class CompositeMetaClass(type(commands.Cog), type(ABC)):
27     """
28     This allows the metaclass used for proper type detection to
29     coexist with discord.py's metaclass
30     """
31 
32     pass
33 
34 
35 @cog_i18n(_)
36 class Mod(
37     ModSettings,
38     Events,
39     KickBanMixin,
40     MuteMixin,
41     ModInfo,
42     Slowmode,
43     commands.Cog,
44     metaclass=CompositeMetaClass,
45 ):
46     """Moderation tools."""
47 
48     default_global_settings = {"version": ""}
49 
50     default_guild_settings = {
51         "ban_mention_spam": False,
52         "delete_repeats": -1,
53         "ignored": False,
54         "respect_hierarchy": True,
55         "delete_delay": -1,
56         "reinvite_on_unban": False,
57         "current_tempbans": [],
58         "dm_on_kickban": False,
59         "default_days": 0,
60     }
61 
62     default_channel_settings = {"ignored": False}
63 
64     default_member_settings = {"past_nicks": [], "perms_cache": {}, "banned_until": False}
65 
66     default_user_settings = {"past_names": []}
67 
68     def __init__(self, bot: Red):
69         super().__init__()
70         self.bot = bot
71 
72         self.config = Config.get_conf(self, 4961522000, force_registration=True)
73         self.config.register_global(**self.default_global_settings)
74         self.config.register_guild(**self.default_guild_settings)
75         self.config.register_channel(**self.default_channel_settings)
76         self.config.register_member(**self.default_member_settings)
77         self.config.register_user(**self.default_user_settings)
78         self.cache: dict = {}
79         self.tban_expiry_task = self.bot.loop.create_task(self.check_tempban_expirations())
80         self.last_case: dict = defaultdict(dict)
81 
82         self._ready = asyncio.Event()
83 
84     async def initialize(self):
85         await self._maybe_update_config()
86         self._ready.set()
87 
88     async def cog_before_invoke(self, ctx: commands.Context) -> None:
89         await self._ready.wait()
90 
91     def cog_unload(self):
92         self.tban_expiry_task.cancel()
93 
94     async def _maybe_update_config(self):
95         """Maybe update `delete_delay` value set by Config prior to Mod 1.0.0."""
96         if not await self.config.version():
97             guild_dict = await self.config.all_guilds()
98             for guild_id, info in guild_dict.items():
99                 delete_repeats = info.get("delete_repeats", False)
100                 if delete_repeats:
101                     val = 3
102                 else:
103                     val = -1
104                 await self.config.guild(discord.Object(id=guild_id)).delete_repeats.set(val)
105             await self.config.version.set("1.0.0")  # set version of last update
106         if await self.config.version() < "1.1.0":
107             msg = _(
108                 "Ignored guilds and channels have been moved. "
109                 "Please use `[p]moveignoredchannels` if "
110                 "you were previously using these functions."
111             )
112             self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))
113             await self.config.version.set("1.1.0")
114         if await self.config.version() < "1.2.0":
115             msg = _(
116                 "Delete delay settings have been moved. "
117                 "Please use `[p]movedeletedelay` if "
118                 "you were previously using these functions."
119             )
120             self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))
121             await self.config.version.set("1.2.0")
122 
123     @commands.command()
124     @commands.is_owner()
125     async def moveignoredchannels(self, ctx: commands.Context) -> None:
126         """Move ignored channels and servers to core"""
127         all_guilds = await self.config.all_guilds()
128         all_channels = await self.config.all_channels()
129         for guild_id, settings in all_guilds.items():
130             await self.bot._config.guild_from_id(guild_id).ignored.set(settings["ignored"])
131             await self.config.guild_from_id(guild_id).ignored.clear()
132         for channel_id, settings in all_channels.items():
133             await self.bot._config.channel_from_id(channel_id).ignored.set(settings["ignored"])
134             await self.config.channel_from_id(channel_id).clear()
135         await ctx.send(_("Ignored channels and guilds restored."))
136 
137     @commands.command()
138     @commands.is_owner()
139     async def movedeletedelay(self, ctx: commands.Context) -> None:
140         """
141             Move deletedelay settings to core
142         """
143         all_guilds = await self.config.all_guilds()
144         for guild_id, settings in all_guilds.items():
145             await self.bot._config.guild_from_id(guild_id).delete_delay.set(
146                 settings["delete_delay"]
147             )
148             await self.config.guild_from_id(guild_id).delete_delay.clear()
149         await ctx.send(_("Delete delay settings restored."))
150
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/redbot/cogs/mod/mod.py b/redbot/cogs/mod/mod.py
--- a/redbot/cogs/mod/mod.py
+++ b/redbot/cogs/mod/mod.py
@@ -6,6 +6,8 @@
 from typing import List, Tuple
 
 import discord
+from redbot.core.utils import AsyncIter
+
 from redbot.core import Config, modlog, commands
 from redbot.core.bot import Red
 from redbot.core.i18n import Translator, cog_i18n
@@ -95,7 +97,7 @@
         """Maybe update `delete_delay` value set by Config prior to Mod 1.0.0."""
         if not await self.config.version():
             guild_dict = await self.config.all_guilds()
-            for guild_id, info in guild_dict.items():
+            async for guild_id, info in AsyncIter(guild_dict.items(), steps=25):
                 delete_repeats = info.get("delete_repeats", False)
                 if delete_repeats:
                     val = 3
@@ -104,20 +106,37 @@
                 await self.config.guild(discord.Object(id=guild_id)).delete_repeats.set(val)
             await self.config.version.set("1.0.0")  # set version of last update
         if await self.config.version() < "1.1.0":
-            msg = _(
-                "Ignored guilds and channels have been moved. "
-                "Please use `[p]moveignoredchannels` if "
-                "you were previously using these functions."
-            )
-            self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))
+            message_sent = False
+            async for e in AsyncIter((await self.config.all_channels()).values(), steps=25):
+                if e["ignored"] is not False:
+                    msg = _(
+                        "Ignored guilds and channels have been moved. "
+                        "Please use `[p]moveignoredchannels` to migrate the old settings."
+                    )
+                    self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))
+                    message_sent = True
+                    break
+            if message_sent is False:
+                async for e in AsyncIter((await self.config.all_guilds()).values(), steps=25):
+                    if e["ignored"] is not False:
+                        msg = _(
+                            "Ignored guilds and channels have been moved. "
+                            "Please use `[p]moveignoredchannels` to migrate the old settings."
+                        )
+                        self.bot.loop.create_task(
+                            send_to_owners_with_prefix_replaced(self.bot, msg)
+                        )
+                        break
             await self.config.version.set("1.1.0")
         if await self.config.version() < "1.2.0":
-            msg = _(
-                "Delete delay settings have been moved. "
-                "Please use `[p]movedeletedelay` if "
-                "you were previously using these functions."
-            )
-            self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))
+            async for e in AsyncIter((await self.config.all_guilds()).values(), steps=25):
+                if e["delete_delay"] != -1:
+                    msg = _(
+                        "Delete delay settings have been moved. "
+                        "Please use `[p]movedeletedelay` to migrate the old settings."
+                    )
+                    self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))
+                    break
             await self.config.version.set("1.2.0")
 
     @commands.command()

{"golden_diff": "diff --git a/redbot/cogs/mod/mod.py b/redbot/cogs/mod/mod.py\n--- a/redbot/cogs/mod/mod.py\n+++ b/redbot/cogs/mod/mod.py\n@@ -6,6 +6,8 @@\n from typing import List, Tuple\n \n import discord\n+from redbot.core.utils import AsyncIter\n+\n from redbot.core import Config, modlog, commands\n from redbot.core.bot import Red\n from redbot.core.i18n import Translator, cog_i18n\n@@ -95,7 +97,7 @@\n         \"\"\"Maybe update `delete_delay` value set by Config prior to Mod 1.0.0.\"\"\"\n         if not await self.config.version():\n             guild_dict = await self.config.all_guilds()\n-            for guild_id, info in guild_dict.items():\n+            async for guild_id, info in AsyncIter(guild_dict.items(), steps=25):\n                 delete_repeats = info.get(\"delete_repeats\", False)\n                 if delete_repeats:\n                     val = 3\n@@ -104,20 +106,37 @@\n                 await self.config.guild(discord.Object(id=guild_id)).delete_repeats.set(val)\n             await self.config.version.set(\"1.0.0\")  # set version of last update\n         if await self.config.version() < \"1.1.0\":\n-            msg = _(\n-                \"Ignored guilds and channels have been moved. \"\n-                \"Please use `[p]moveignoredchannels` if \"\n-                \"you were previously using these functions.\"\n-            )\n-            self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))\n+            message_sent = False\n+            async for e in AsyncIter((await self.config.all_channels()).values(), steps=25):\n+                if e[\"ignored\"] is not False:\n+                    msg = _(\n+                        \"Ignored guilds and channels have been moved. \"\n+                        \"Please use `[p]moveignoredchannels` to migrate the old settings.\"\n+                    )\n+                    self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))\n+                    message_sent = True\n+                    break\n+            if message_sent is False:\n+                async for e in AsyncIter((await self.config.all_guilds()).values(), steps=25):\n+                    if e[\"ignored\"] is not False:\n+                        msg = _(\n+                            \"Ignored guilds and channels have been moved. \"\n+                            \"Please use `[p]moveignoredchannels` to migrate the old settings.\"\n+                        )\n+                        self.bot.loop.create_task(\n+                            send_to_owners_with_prefix_replaced(self.bot, msg)\n+                        )\n+                        break\n             await self.config.version.set(\"1.1.0\")\n         if await self.config.version() < \"1.2.0\":\n-            msg = _(\n-                \"Delete delay settings have been moved. \"\n-                \"Please use `[p]movedeletedelay` if \"\n-                \"you were previously using these functions.\"\n-            )\n-            self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))\n+            async for e in AsyncIter((await self.config.all_guilds()).values(), steps=25):\n+                if e[\"delete_delay\"] != -1:\n+                    msg = _(\n+                        \"Delete delay settings have been moved. \"\n+                        \"Please use `[p]movedeletedelay` to migrate the old settings.\"\n+                    )\n+                    self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))\n+                    break\n             await self.config.version.set(\"1.2.0\")\n \n     @commands.command()\n", "issue": "Mod cog sends owner notifications on fresh install.\n# Other bugs\r\n\r\nI got reminded about it when I saw a fix for #3587. Mod cog sends owner notifications about `[p]moveignoredchannels` and `[p]movedeletedelay` on fresh Red installs. Only viable solution seems to be looping through all guild settings and only send the message if `delete_delay` has been changed from the default in at least one of them though I'm basing that on my comment [here](https://github.com/Cog-Creators/Red-DiscordBot/pull/3638#discussion_r392119234).\r\n\n", "before_files": [{"content": "import asyncio\nimport logging\nimport re\nfrom abc import ABC\nfrom collections import defaultdict\nfrom typing import List, Tuple\n\nimport discord\nfrom redbot.core import Config, modlog, commands\nfrom redbot.core.bot import Red\nfrom redbot.core.i18n import Translator, cog_i18n\nfrom redbot.core.utils._internal_utils import send_to_owners_with_prefix_replaced\nfrom .casetypes import CASETYPES\nfrom .events import Events\nfrom .kickban import KickBanMixin\nfrom .mutes import MuteMixin\nfrom .names import ModInfo\nfrom .slowmode import Slowmode\nfrom .settings import ModSettings\n\n_ = T_ = Translator(\"Mod\", __file__)\n\n__version__ = \"1.2.0\"\n\n\nclass CompositeMetaClass(type(commands.Cog), type(ABC)):\n    \"\"\"\n    This allows the metaclass used for proper type detection to\n    coexist with discord.py's metaclass\n    \"\"\"\n\n    pass\n\n\n@cog_i18n(_)\nclass Mod(\n    ModSettings,\n    Events,\n    KickBanMixin,\n    MuteMixin,\n    ModInfo,\n    Slowmode,\n    commands.Cog,\n    metaclass=CompositeMetaClass,\n):\n    \"\"\"Moderation tools.\"\"\"\n\n    default_global_settings = {\"version\": \"\"}\n\n    default_guild_settings = {\n        \"ban_mention_spam\": False,\n        \"delete_repeats\": -1,\n        \"ignored\": False,\n        \"respect_hierarchy\": True,\n        \"delete_delay\": -1,\n        \"reinvite_on_unban\": False,\n        \"current_tempbans\": [],\n        \"dm_on_kickban\": False,\n        \"default_days\": 0,\n    }\n\n    default_channel_settings = {\"ignored\": False}\n\n    default_member_settings = {\"past_nicks\": [], \"perms_cache\": {}, \"banned_until\": False}\n\n    default_user_settings = {\"past_names\": []}\n\n    def __init__(self, bot: Red):\n        super().__init__()\n        self.bot = bot\n\n        self.config = Config.get_conf(self, 4961522000, force_registration=True)\n        self.config.register_global(**self.default_global_settings)\n        self.config.register_guild(**self.default_guild_settings)\n        self.config.register_channel(**self.default_channel_settings)\n        self.config.register_member(**self.default_member_settings)\n        self.config.register_user(**self.default_user_settings)\n        self.cache: dict = {}\n        self.tban_expiry_task = self.bot.loop.create_task(self.check_tempban_expirations())\n        self.last_case: dict = defaultdict(dict)\n\n        self._ready = asyncio.Event()\n\n    async def initialize(self):\n        await self._maybe_update_config()\n        self._ready.set()\n\n    async def cog_before_invoke(self, ctx: commands.Context) -> None:\n        await self._ready.wait()\n\n    def cog_unload(self):\n        self.tban_expiry_task.cancel()\n\n    async def _maybe_update_config(self):\n        \"\"\"Maybe update `delete_delay` value set by Config prior to Mod 1.0.0.\"\"\"\n        if not await self.config.version():\n            guild_dict = await self.config.all_guilds()\n            for guild_id, info in guild_dict.items():\n                delete_repeats = info.get(\"delete_repeats\", False)\n                if delete_repeats:\n                    val = 3\n                else:\n                    val = -1\n                await self.config.guild(discord.Object(id=guild_id)).delete_repeats.set(val)\n            await self.config.version.set(\"1.0.0\")  # set version of last update\n        if await self.config.version() < \"1.1.0\":\n            msg = _(\n                \"Ignored guilds and channels have been moved. \"\n                \"Please use `[p]moveignoredchannels` if \"\n                \"you were previously using these functions.\"\n            )\n            self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))\n            await self.config.version.set(\"1.1.0\")\n        if await self.config.version() < \"1.2.0\":\n            msg = _(\n                \"Delete delay settings have been moved. \"\n                \"Please use `[p]movedeletedelay` if \"\n                \"you were previously using these functions.\"\n            )\n            self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))\n            await self.config.version.set(\"1.2.0\")\n\n    @commands.command()\n    @commands.is_owner()\n    async def moveignoredchannels(self, ctx: commands.Context) -> None:\n        \"\"\"Move ignored channels and servers to core\"\"\"\n        all_guilds = await self.config.all_guilds()\n        all_channels = await self.config.all_channels()\n        for guild_id, settings in all_guilds.items():\n            await self.bot._config.guild_from_id(guild_id).ignored.set(settings[\"ignored\"])\n            await self.config.guild_from_id(guild_id).ignored.clear()\n        for channel_id, settings in all_channels.items():\n            await self.bot._config.channel_from_id(channel_id).ignored.set(settings[\"ignored\"])\n            await self.config.channel_from_id(channel_id).clear()\n        await ctx.send(_(\"Ignored channels and guilds restored.\"))\n\n    @commands.command()\n    @commands.is_owner()\n    async def movedeletedelay(self, ctx: commands.Context) -> None:\n        \"\"\"\n            Move deletedelay settings to core\n        \"\"\"\n        all_guilds = await self.config.all_guilds()\n        for guild_id, settings in all_guilds.items():\n            await self.bot._config.guild_from_id(guild_id).delete_delay.set(\n                settings[\"delete_delay\"]\n            )\n            await self.config.guild_from_id(guild_id).delete_delay.clear()\n        await ctx.send(_(\"Delete delay settings restored.\"))\n", "path": "redbot/cogs/mod/mod.py"}], "after_files": [{"content": "import asyncio\nimport logging\nimport re\nfrom abc import ABC\nfrom collections import defaultdict\nfrom typing import List, Tuple\n\nimport discord\nfrom redbot.core.utils import AsyncIter\n\nfrom redbot.core import Config, modlog, commands\nfrom redbot.core.bot import Red\nfrom redbot.core.i18n import Translator, cog_i18n\nfrom redbot.core.utils._internal_utils import send_to_owners_with_prefix_replaced\nfrom .casetypes import CASETYPES\nfrom .events import Events\nfrom .kickban import KickBanMixin\nfrom .mutes import MuteMixin\nfrom .names import ModInfo\nfrom .slowmode import Slowmode\nfrom .settings import ModSettings\n\n_ = T_ = Translator(\"Mod\", __file__)\n\n__version__ = \"1.2.0\"\n\n\nclass CompositeMetaClass(type(commands.Cog), type(ABC)):\n    \"\"\"\n    This allows the metaclass used for proper type detection to\n    coexist with discord.py's metaclass\n    \"\"\"\n\n    pass\n\n\n@cog_i18n(_)\nclass Mod(\n    ModSettings,\n    Events,\n    KickBanMixin,\n    MuteMixin,\n    ModInfo,\n    Slowmode,\n    commands.Cog,\n    metaclass=CompositeMetaClass,\n):\n    \"\"\"Moderation tools.\"\"\"\n\n    default_global_settings = {\"version\": \"\"}\n\n    default_guild_settings = {\n        \"ban_mention_spam\": False,\n        \"delete_repeats\": -1,\n        \"ignored\": False,\n        \"respect_hierarchy\": True,\n        \"delete_delay\": -1,\n        \"reinvite_on_unban\": False,\n        \"current_tempbans\": [],\n        \"dm_on_kickban\": False,\n        \"default_days\": 0,\n    }\n\n    default_channel_settings = {\"ignored\": False}\n\n    default_member_settings = {\"past_nicks\": [], \"perms_cache\": {}, \"banned_until\": False}\n\n    default_user_settings = {\"past_names\": []}\n\n    def __init__(self, bot: Red):\n        super().__init__()\n        self.bot = bot\n\n        self.config = Config.get_conf(self, 4961522000, force_registration=True)\n        self.config.register_global(**self.default_global_settings)\n        self.config.register_guild(**self.default_guild_settings)\n        self.config.register_channel(**self.default_channel_settings)\n        self.config.register_member(**self.default_member_settings)\n        self.config.register_user(**self.default_user_settings)\n        self.cache: dict = {}\n        self.tban_expiry_task = self.bot.loop.create_task(self.check_tempban_expirations())\n        self.last_case: dict = defaultdict(dict)\n\n        self._ready = asyncio.Event()\n\n    async def initialize(self):\n        await self._maybe_update_config()\n        self._ready.set()\n\n    async def cog_before_invoke(self, ctx: commands.Context) -> None:\n        await self._ready.wait()\n\n    def cog_unload(self):\n        self.tban_expiry_task.cancel()\n\n    async def _maybe_update_config(self):\n        \"\"\"Maybe update `delete_delay` value set by Config prior to Mod 1.0.0.\"\"\"\n        if not await self.config.version():\n            guild_dict = await self.config.all_guilds()\n            async for guild_id, info in AsyncIter(guild_dict.items(), steps=25):\n                delete_repeats = info.get(\"delete_repeats\", False)\n                if delete_repeats:\n                    val = 3\n                else:\n                    val = -1\n                await self.config.guild(discord.Object(id=guild_id)).delete_repeats.set(val)\n            await self.config.version.set(\"1.0.0\")  # set version of last update\n        if await self.config.version() < \"1.1.0\":\n            message_sent = False\n            async for e in AsyncIter((await self.config.all_channels()).values(), steps=25):\n                if e[\"ignored\"] is not False:\n                    msg = _(\n                        \"Ignored guilds and channels have been moved. \"\n                        \"Please use `[p]moveignoredchannels` to migrate the old settings.\"\n                    )\n                    self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))\n                    message_sent = True\n                    break\n            if message_sent is False:\n                async for e in AsyncIter((await self.config.all_guilds()).values(), steps=25):\n                    if e[\"ignored\"] is not False:\n                        msg = _(\n                            \"Ignored guilds and channels have been moved. \"\n                            \"Please use `[p]moveignoredchannels` to migrate the old settings.\"\n                        )\n                        self.bot.loop.create_task(\n                            send_to_owners_with_prefix_replaced(self.bot, msg)\n                        )\n                        break\n            await self.config.version.set(\"1.1.0\")\n        if await self.config.version() < \"1.2.0\":\n            async for e in AsyncIter((await self.config.all_guilds()).values(), steps=25):\n                if e[\"delete_delay\"] != -1:\n                    msg = _(\n                        \"Delete delay settings have been moved. \"\n                        \"Please use `[p]movedeletedelay` to migrate the old settings.\"\n                    )\n                    self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))\n                    break\n            await self.config.version.set(\"1.2.0\")\n\n    @commands.command()\n    @commands.is_owner()\n    async def moveignoredchannels(self, ctx: commands.Context) -> None:\n        \"\"\"Move ignored channels and servers to core\"\"\"\n        all_guilds = await self.config.all_guilds()\n        all_channels = await self.config.all_channels()\n        for guild_id, settings in all_guilds.items():\n            await self.bot._config.guild_from_id(guild_id).ignored.set(settings[\"ignored\"])\n            await self.config.guild_from_id(guild_id).ignored.clear()\n        for channel_id, settings in all_channels.items():\n            await self.bot._config.channel_from_id(channel_id).ignored.set(settings[\"ignored\"])\n            await self.config.channel_from_id(channel_id).clear()\n        await ctx.send(_(\"Ignored channels and guilds restored.\"))\n\n    @commands.command()\n    @commands.is_owner()\n    async def movedeletedelay(self, ctx: commands.Context) -> None:\n        \"\"\"\n            Move deletedelay settings to core\n        \"\"\"\n        all_guilds = await self.config.all_guilds()\n        for guild_id, settings in all_guilds.items():\n            await self.bot._config.guild_from_id(guild_id).delete_delay.set(\n                settings[\"delete_delay\"]\n            )\n            await self.config.guild_from_id(guild_id).delete_delay.clear()\n        await ctx.send(_(\"Delete delay settings restored.\"))\n", "path": "redbot/cogs/mod/mod.py"}]}