aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/halloween/monstersurvey.py
diff options
context:
space:
mode:
authorGravatar Matteo Bertucci <[email protected]>2020-11-30 15:18:42 +0100
committerGravatar GitHub <[email protected]>2020-11-30 15:18:42 +0100
commit0ad849431eee3cab48485a132df23b0883142cf6 (patch)
treed9bd17fbd8f22c45e682079f6e3e565b6e17f61d /bot/exts/halloween/monstersurvey.py
parent"adding xkcd feature" (diff)
parentMerge pull request #532 from python-discord/sebastiaan/ci/add-core-dev-approv... (diff)
Merge branch 'master' into issue-337
Diffstat (limited to 'bot/exts/halloween/monstersurvey.py')
-rw-r--r--bot/exts/halloween/monstersurvey.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/bot/exts/halloween/monstersurvey.py b/bot/exts/halloween/monstersurvey.py
index 27da79b6..80196825 100644
--- a/bot/exts/halloween/monstersurvey.py
+++ b/bot/exts/halloween/monstersurvey.py
@@ -27,13 +27,13 @@ class MonsterSurvey(Cog):
"""Initializes values for the bot to use within the voting commands."""
self.bot = bot
self.registry_location = os.path.join(os.getcwd(), 'bot', 'resources', 'halloween', 'monstersurvey.json')
- with open(self.registry_location, 'r') as jason:
+ with open(self.registry_location, 'r', encoding="utf8") as jason:
self.voter_registry = json.load(jason)
def json_write(self) -> None:
"""Write voting results to a local JSON file."""
log.info("Saved Monster Survey Results")
- with open(self.registry_location, 'w') as jason:
+ with open(self.registry_location, 'w', encoding="utf8") as jason:
json.dump(self.voter_registry, jason, indent=2)
def cast_vote(self, id: int, monster: str) -> None:
@@ -202,4 +202,3 @@ class MonsterSurvey(Cog):
def setup(bot: Bot) -> None:
"""Monster survey Cog load."""
- bot.add_cog(MonsterSurvey(bot))