diff --git a/conquest/__init__.py b/conquest/__init__.py index 1466d52..bb8992e 100644 --- a/conquest/__init__.py +++ b/conquest/__init__.py @@ -1,6 +1,7 @@ from redbot.core import data_manager from .conquest import Conquest +from .mapmaker import MapMaker async def setup(bot): @@ -9,3 +10,6 @@ async def setup(bot): await cog.load_data() bot.add_cog(cog) + + cog2 = MapMaker(bot) + bot.add_cog(cog2) diff --git a/conquest/conquest.py b/conquest/conquest.py index ea57382..70425aa 100644 --- a/conquest/conquest.py +++ b/conquest/conquest.py @@ -14,43 +14,6 @@ from redbot.core.bot import Red from redbot.core.data_manager import bundled_data_path, cog_data_path -class MapMaker(commands.Cog): - """""" - def __init__(self, bot: Red): - super().__init__() - self.bot = bot - - self.config = Config.get_conf( - self, identifier=77971127797107101114, force_registration=True - ) - - default_guild = {} - default_global = {} - self.config.register_guild(**default_guild) - self.config.register_global(**default_global) - - - @commands.group() - async def mapmaker(self, ctx: commands.context): - """ - Base command for managing current maps or creating new ones - """ - if ctx.invoked_subcommand is None: - pass - - @mapmaker.command(name="upload") - async def _mapmaker_upload(self, ctx: commands.Context, map_path=""): - """Load a map image to be modified. Upload one with this command or provide a path""" - message: discord.Message = ctx.message - if not message.attachments and not map_path: - await ctx.maybe_send_embed("Either upload an image with this command or provide a path to the image") - return - - @mapmaker.command(name="load") - async def _mapmaker_load(self, ctx: commands.Context, map_name=""): - """Load an existing map to be modified.""" - - class Conquest(commands.Cog): """ Cog for diff --git a/conquest/mapmaker.py b/conquest/mapmaker.py new file mode 100644 index 0000000..5f302e5 --- /dev/null +++ b/conquest/mapmaker.py @@ -0,0 +1,46 @@ +import discord +from redbot.core import Config, commands +from redbot.core.bot import Red + + +class MapMaker(commands.Cog): + """ + Create Maps to be used with Conquest + """ + + def __init__(self, bot: Red): + super().__init__() + self.bot = bot + + self.config = Config.get_conf( + self, identifier=77971127797107101114, force_registration=True + ) + + default_guild = {} + default_global = {} + self.config.register_guild(**default_guild) + self.config.register_global(**default_global) + + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + + @commands.group() + async def mapmaker(self, ctx: commands.context): + """ + Base command for managing current maps or creating new ones + """ + if ctx.invoked_subcommand is None: + pass + + @mapmaker.command(name="upload") + async def _mapmaker_upload(self, ctx: commands.Context, map_path=""): + """Load a map image to be modified. Upload one with this command or provide a path""" + message: discord.Message = ctx.message + if not message.attachments and not map_path: + await ctx.maybe_send_embed("Either upload an image with this command or provide a path to the image") + return + + @mapmaker.command(name="load") + async def _mapmaker_load(self, ctx: commands.Context, map_name=""): + """Load an existing map to be modified."""