diff --git a/reactquote/__init__.py b/reactquote/__init__.py deleted file mode 100644 index daeaa1f..0000000 --- a/reactquote/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .reactquote import ReactQuote - - -def setup(bot): - bot.add_cog(ReactQuote(bot)) \ No newline at end of file diff --git a/reactquote/reactquote.py b/reactquote/reactquote.py index 76b5bc4..5225134 100644 --- a/reactquote/reactquote.py +++ b/reactquote/reactquote.py @@ -1,13 +1,47 @@ from redbot.core import commands +from redbot.core.utils import fileIO +from __main__ import send_cmd_help +import os +from random import choice as randchoice class ReactQuote(commands.Cog): """Cog to store quotes by reacting with speech bubble""" def __init__(self, bot): self.bot = bot + self.quotes = fileIO("data/quotes/quotes.json", "load") + + def _wrapQuote(self, msg): + return msg @commands.command() async def reactquote(self, ctx): """TestCommand""" # Your code will go here - await ctx.send("I can do stuff, really!") \ No newline at end of file + await ctx.send("I can do stuff, really!") + + @commands.command() + async def addquote(self, *message): + """Manually Add Quote""" + self.bot.say(message) + +def check_folder(): + if not os.path.exists("data/reactquote"): + print("Creating data/reactquote folder...") + os.makedirs("data/reactquote") + + +def check_file(self): + quotes = {} + + f = "data/reactquote/reactquote.json" + if not fileIO(f, "check"): + print("Creating default reactquote's reactquote.json...") + fileIO(f, "save", quotes) + + +def setup(bot): + check_folder() + check_file() + n = ReactQuote(bot) + bot.add_cog(n) \ No newline at end of file