aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/resources/halloween/responses.json14
-rw-r--r--bot/seasons/halloween/8ball.py35
2 files changed, 49 insertions, 0 deletions
diff --git a/bot/resources/halloween/responses.json b/bot/resources/halloween/responses.json
new file mode 100644
index 00000000..c0f24c1a
--- /dev/null
+++ b/bot/resources/halloween/responses.json
@@ -0,0 +1,14 @@
+{
+ "responses": [
+ ["No."],
+ ["Yes."],
+ ["I will seek and answer from the devil...", "...after requesting the devils knowledge the answer is far more complicated than a simple yes or no."],
+ ["This knowledge is not available to me, I will seek the answers from someone far more powerful...", "...there is no answer to this question, not even the Grim Reaper could find an answer."],
+ ["The ghosts I summoned have confirmed that is is certain."],
+ ["Double, double, toil and trouble,\nFire burn and cauldron bubble.\nCool it with a baboon's blood,\nand tell me the answer to his question...", "...the great cauldron can only confirm your beliefs."],
+ ["Double, double, toil and trouble,\nFire burn and cauldron bubble.\nCool it with a baboon's blood,\nand tell me the answer to his question...", "...the great cauldron can only confirm that the answer to your question is no."],
+ ["If I tell you I will have to kill you..."],
+ ["I swear on my spider that you are correct."],
+ ["With great certainty, under the watch of the Pumpkin King, I can confirm your suspicions."],
+ ["The undead have sworn me to secrecy. I can not answer your question."]
+]}
diff --git a/bot/seasons/halloween/8ball.py b/bot/seasons/halloween/8ball.py
new file mode 100644
index 00000000..af037e53
--- /dev/null
+++ b/bot/seasons/halloween/8ball.py
@@ -0,0 +1,35 @@
+import asyncio
+import json
+import logging
+import random
+from pathlib import Path
+
+from discord.ext import commands
+
+log = logging.getLogger(__name__)
+
+with open(Path('bot', 'resources', 'halloween', 'responses.json'), 'r', encoding="utf8") as f:
+ responses = json.load(f)
+
+
+class SpookyEightBall(commands.Cog):
+ """Spooky Eightball answers."""
+
+ def __init__(self, bot):
+ self.bot = bot
+
+ @commands.command(aliases=('spooky8ball',))
+ async def spookyeightball(self, ctx, *, question: str):
+ """Responds with a random response to a question."""
+ choice = random.choice(responses['responses'])
+ msg = await ctx.send(choice[0])
+ if len(choice) > 1:
+ await asyncio.sleep(random.randint(2, 5))
+ await msg.edit(content=f"{choice[0]} \n{choice[1]}")
+
+
+def setup(bot):
+ """Spooky Eight Ball Cog Load."""
+
+ bot.add_cog(SpookyEightBall(bot))
+ log.info("SpookyEightBall cog loaded")