From df327e7233310e0444c2266d5618d6f47c681907 Mon Sep 17 00:00:00 2001 From: Juni Date: Sun, 10 Apr 2022 09:32:42 -0400 Subject: [PATCH] readd init --- reactquote/__init__.py | 24 ++++++++++++++++++++++++ reactquote/reactquote.py | 23 +---------------------- 2 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 reactquote/__init__.py diff --git a/reactquote/__init__.py b/reactquote/__init__.py new file mode 100644 index 0000000..077c484 --- /dev/null +++ b/reactquote/__init__.py @@ -0,0 +1,24 @@ +from .reactquote import ReactQuote +from redbot.core.utils import fileIO +import os + +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 diff --git a/reactquote/reactquote.py b/reactquote/reactquote.py index 5225134..cb10e58 100644 --- a/reactquote/reactquote.py +++ b/reactquote/reactquote.py @@ -23,25 +23,4 @@ class ReactQuote(commands.Cog): @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 + self.bot.say(message) \ No newline at end of file