readd init

This commit is contained in:
Juni
2022-04-10 09:32:42 -04:00
parent 7a2f6b6eea
commit df327e7233
2 changed files with 25 additions and 22 deletions

24
reactquote/__init__.py Normal file
View File

@@ -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)

View File

@@ -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)
self.bot.say(message)