Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
BackupBot/extensions/help.py

33 lines
687 B
Python
Raw Normal View History

2020-03-27 16:00:12 +01:00
from discord.ext import commands
from backup_bot.logger import logger
extension_name = "help"
logger = logger.getChild(extension_name)
@commands.command("help")
async def help_cmd(ctx):
await ctx.send("Help !")
def setup(bot):
2020-03-28 14:07:30 +01:00
logger.info(f"Loading...")
2020-03-27 16:00:12 +01:00
try:
bot.help_command = None
bot.add_command(help_cmd)
except Exception as e:
2020-03-28 14:07:30 +01:00
logger.error(f"Error loading: {e}")
2020-03-27 16:00:12 +01:00
else:
2020-03-28 14:07:30 +01:00
logger.info(f"Load successful")
2020-03-27 16:00:12 +01:00
def teardown(bot):
2020-03-28 14:07:30 +01:00
logger.info(f"Unloading...")
2020-03-27 16:00:12 +01:00
try:
bot.remove_command("help")
except Exception as e:
2020-03-28 14:07:30 +01:00
logger.error(f"Error unloading: {e}")
2020-03-27 16:00:12 +01:00
else:
2020-03-28 14:07:30 +01:00
logger.info(f"Unload successful")