Split mapmaker

pull/115/head
bobloy 5 years ago
parent ae200eb911
commit 3b156d8275

@ -1,6 +1,7 @@
from redbot.core import data_manager from redbot.core import data_manager
from .conquest import Conquest from .conquest import Conquest
from .mapmaker import MapMaker
async def setup(bot): async def setup(bot):
@ -9,3 +10,6 @@ async def setup(bot):
await cog.load_data() await cog.load_data()
bot.add_cog(cog) bot.add_cog(cog)
cog2 = MapMaker(bot)
bot.add_cog(cog2)

@ -14,43 +14,6 @@ from redbot.core.bot import Red
from redbot.core.data_manager import bundled_data_path, cog_data_path 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): class Conquest(commands.Cog):
""" """
Cog for Cog for

@ -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."""
Loading…
Cancel
Save