aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2020-11-14 22:56:36 +0100
committerGravatar GitHub <[email protected]>2020-11-14 22:56:36 +0100
commit4ed015aae21045876761284902c337da724b81eb (patch)
tree9bcc70435c2554c96de0c48376fae3af6b9816a7 /bot/exts
parentFix typo in GitHub workflow (diff)
parentRemove make_persistent import from bot extensions (diff)
Merge pull request #515 from python-discord/feature/non-persistence
Remove persistence requirements from Seasonalbot
Diffstat (limited to 'bot/exts')
-rw-r--r--bot/exts/evergreen/branding.py29
-rw-r--r--bot/exts/halloween/candy_collection.py5
-rw-r--r--bot/exts/halloween/hacktoberstats.py5
-rw-r--r--bot/exts/halloween/monstersurvey.py1
4 files changed, 19 insertions, 21 deletions
diff --git a/bot/exts/evergreen/branding.py b/bot/exts/evergreen/branding.py
index 7e531011..b55c9b14 100644
--- a/bot/exts/evergreen/branding.py
+++ b/bot/exts/evergreen/branding.py
@@ -18,7 +18,8 @@ from bot.seasons import SeasonBase, get_all_seasons, get_current_season, get_sea
from bot.utils import human_months
from bot.utils.decorators import with_role
from bot.utils.exceptions import BrandingError
-from bot.utils.persist import make_persistent
+# TODO: Implement substitute for current volume persistence requirements
+# from bot.utils.persist import make_persistent
log = logging.getLogger(__name__)
@@ -156,13 +157,14 @@ class BrandingManager(commands.Cog):
self.days_since_cycle = itertools.cycle([None])
- self.config_file = make_persistent(Path("bot", "resources", "evergreen", "branding.json"))
- should_run = self._read_config()["daemon_active"]
+ # self.config_file = make_persistent(Path("bot", "resources", "evergreen", "branding.json"))
- if should_run:
- self.daemon = self.bot.loop.create_task(self._daemon_func())
- else:
- self.daemon = None
+ # should_run = self._read_config()["daemon_active"]
+
+ # if should_run:
+ # self.daemon = self.bot.loop.create_task(self._daemon_func())
+ # else:
+ self.daemon = None
@property
def _daemon_running(self) -> bool:
@@ -171,16 +173,11 @@ class BrandingManager(commands.Cog):
def _read_config(self) -> t.Dict[str, bool]:
"""Read and return persistent config file."""
- with self.config_file.open("r", encoding="utf8") as persistent_file:
- return json.load(persistent_file)
+ raise NotImplementedError("read_config functionality requires mounting a persistent volume.")
def _write_config(self, key: str, value: bool) -> None:
"""Write a `key`, `value` pair to persistent config file."""
- current_config = self._read_config()
- current_config[key] = value
-
- with self.config_file.open("w", encoding="utf8") as persistent_file:
- json.dump(current_config, persistent_file)
+ raise NotImplementedError("write_config functionality requires mounting a persistent volume.")
async def _daemon_func(self) -> None:
"""
@@ -513,7 +510,7 @@ class BrandingManager(commands.Cog):
await ctx.send(embed=response)
- @daemon_group.command(name="start")
+ @daemon_group.command(name="start", enabled=False)
async def daemon_start(self, ctx: commands.Context) -> None:
"""If the daemon isn't running, start it."""
if self._daemon_running:
@@ -525,7 +522,7 @@ class BrandingManager(commands.Cog):
response = discord.Embed(description=f"Daemon started {Emojis.ok_hand}", colour=Colours.soft_green)
await ctx.send(embed=response)
- @daemon_group.command(name="stop")
+ @daemon_group.command(name="stop", enabled=False)
async def daemon_stop(self, ctx: commands.Context) -> None:
"""If the daemon is running, stop it."""
if not self._daemon_running:
diff --git a/bot/exts/halloween/candy_collection.py b/bot/exts/halloween/candy_collection.py
index a862e1af..7bdc6ef0 100644
--- a/bot/exts/halloween/candy_collection.py
+++ b/bot/exts/halloween/candy_collection.py
@@ -9,7 +9,9 @@ from discord.ext import commands
from bot.constants import Channels, Month
from bot.utils.decorators import in_month
-from bot.utils.persist import make_persistent
+
+# TODO: Implement substitutes for volume-persistent methods.
+# from bot.utils.persist import make_persistent
log = logging.getLogger(__name__)
@@ -197,4 +199,3 @@ class CandyCollection(commands.Cog):
def setup(bot: commands.Bot) -> None:
"""Candy Collection game Cog load."""
- bot.add_cog(CandyCollection(bot))
diff --git a/bot/exts/halloween/hacktoberstats.py b/bot/exts/halloween/hacktoberstats.py
index d2762513..beff86e3 100644
--- a/bot/exts/halloween/hacktoberstats.py
+++ b/bot/exts/halloween/hacktoberstats.py
@@ -12,7 +12,9 @@ from discord.ext import commands
from bot.constants import Channels, Month, Tokens, WHITELISTED_CHANNELS
from bot.utils.decorators import in_month, override_in_channel
-from bot.utils.persist import make_persistent
+
+# TODO: Implement substitutes for volume-persistent methods.
+# from bot.utils.persist import make_persistent
log = logging.getLogger(__name__)
@@ -489,4 +491,3 @@ class HacktoberStats(commands.Cog):
def setup(bot: commands.Bot) -> None:
"""Hacktoberstats Cog load."""
- bot.add_cog(HacktoberStats(bot))
diff --git a/bot/exts/halloween/monstersurvey.py b/bot/exts/halloween/monstersurvey.py
index 7b1a1e84..80196825 100644
--- a/bot/exts/halloween/monstersurvey.py
+++ b/bot/exts/halloween/monstersurvey.py
@@ -202,4 +202,3 @@ class MonsterSurvey(Cog):
def setup(bot: Bot) -> None:
"""Monster survey Cog load."""
- bot.add_cog(MonsterSurvey(bot))