# Path: dozer/bot.py
# DOZER_LOGGER = logging.getLogger('dozer')


import os
import sys
from discord.ext.commands import NotOwner
from dozer.bot import DOZER_LOGGER
from ._utils import *
    Commands for performing maintenance on the bot.
    These commands are restricted to bot developers.
    """

    def cog_check(self, ctx):  # All of this cog is only available to devs
        if ctx.author.id not in ctx.bot.config['developers']:
            raise NotOwner('you are not a developer!')
        return True

    @command()
    async def shutdown(self, ctx):
        """Force-stops the bot."""
        await ctx.send('Shutting down')
        DOZER_LOGGER.info('Shutting down at request of {}#{} (in {}, #{})'.format(ctx.author.name,
                                                                                  ctx.author.discriminator,
                                                                                  ctx.guild.name,
                                                                                  ctx.channel.name))
        await self.bot.shutdown()

    shutdown.example_usage = """
    `{prefix}shutdown` - stop the bot
    """

    @command()
    async def restart(self, ctx):
        """Restarts the bot."""
        await ctx.send('Restarting')
        await self.bot.shutdown(restart=True)

    restart.example_usage = """

# Path: dozer/bot.py
# DOZER_LOGGER = logging.getLogger('dozer')


# Path: dozer/cogs/maintenance.py
import os
import sys
from discord.ext.commands import NotOwner
from dozer.bot import DOZER_LOGGER
from ._utils import *

    Commands for performing maintenance on the bot.
    These commands are restricted to bot developers.
    """

    def cog_check(self, ctx):  # All of this cog is only available to devs
        if ctx.author.id not in ctx.bot.config['developers']:
            raise NotOwner('you are not a developer!')
        return True

    @command()
    async def shutdown(self, ctx):
        """Force-stops the bot."""
        await ctx.send('Shutting down')
        DOZER_LOGGER.info('Shutting down at request of {}#{} (in {}, #{})'.format(ctx.author.name,
                                                                                  ctx.author.discriminator,
                                                                                  ctx.guild.name,
                                                                                  ctx.channel.name))
        await self.bot.shutdown()

    shutdown.example_usage = """
    `{prefix}shutdown` - stop the bot
    """

    @command()
    async def restart(self, ctx):
        """Restarts the bot."""
        await ctx.send('Restarting')
        await self.bot.shutdown(restart=True)

    restart.example_usage = """

    `{prefix}restart` - restart the bot