aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RohanRadia <[email protected]>2019-04-04 13:17:58 +0100
committerGravatar RohanRadia <[email protected]>2019-04-04 13:17:58 +0100
commit9e2da79fcd5e0d54f13459cd8301631789719ef2 (patch)
treee6cbccfa6d12b2b4ec8a3c41ddca7c7e01ad08a1
parentJSON file to store all conversation starters in as requested. (diff)
Updated the file and added dependancies for accesing the new JSON file
Diffstat (limited to '')
-rw-r--r--conversationstarters.py28
1 files changed, 5 insertions, 23 deletions
diff --git a/conversationstarters.py b/conversationstarters.py
index 9713598c..38226557 100644
--- a/conversationstarters.py
+++ b/conversationstarters.py
@@ -1,32 +1,14 @@
+import json
import logging
import random
+from pathlib import Path
from discord.ext import commands
log = logging.getLogger(__name__)
-starters = [
- 'What is your favourite Easter candy or treat?',
- 'What is your earliest memory of Easter?',
- 'What is the title of the last book you read?',
- 'What is better: Milk, Dark or White chocolate?',
- 'What is your favourite holiday?',
- 'If you could have any superpower, what would it be?',
- 'Name one thing you like about a person to your right.',
- 'If you could be anyone else for one day, who would it be?',
- 'What Easter tradition do you enjoy most?',
- "What is the best gift you've been given?",
- 'Name one famous person you would like to have at your easter dinner.',
- 'What was the last movie you saw in a cinema?',
- 'What is your favourite food?',
- 'If you could travel anywhere in the world, where would you go?',
- 'Tell us 5 things you do well.',
- 'What is your favourite place that you have visited?',
- 'What is your favourite color?',
- 'If you had $100 bill in your Easter Basket, what would you do with it?',
- 'What would you do if you know you could succeed at anything you chose to do?',
- 'If you could take only three things from your house, what would they be?'
-]
+with open(Path('bot', 'resources', 'easter', 'starter.json'), 'r', encoding="utf8") as f:
+ starters = json.load(f)
class ConvoStarters(commands.Cog):
@@ -39,7 +21,7 @@ class ConvoStarters(commands.Cog):
async def convo_starter(self, ctx):
"""Responds with a random conversation starter"""
- await ctx.send(f"{random.choice(starters)}")
+ await ctx.send(f"{random.choice(starters['starters'])}")
def setup(bot):