def setup(bot: ButtercupBot) -> None: """Set up the Find cog.""" cog_config = bot.config["Blossom"] email = cog_config.get("email") password = cog_config.get("password") api_key = cog_config.get("api_key") blossom_api = BlossomAPI(email=email, password=password, api_key=api_key) bot.add_cog(Find(bot=bot, blossom_api=blossom_api))
def setup(bot: ButtercupBot) -> None: """Set up the History cog.""" # Initialize blossom api cog_config = bot.config["Blossom"] email = cog_config.get("email") password = cog_config.get("password") api_key = cog_config.get("api_key") blossom_api = BlossomAPI(email=email, password=password, api_key=api_key) bot.add_cog(History(bot=bot, blossom_api=blossom_api))
def setup(bot: ButtercupBot) -> None: """Set up the Rules cog.""" reddit_config = bot.config["Reddit"] reddit_api = asyncpraw.Reddit( client_id=reddit_config["client_id"], client_secret=reddit_config["client_secret"], user_agent=reddit_config["user_agent"], ) bot.add_cog(Rules(bot=bot, reddit_api=reddit_api))
def teardown(bot: ButtercupBot) -> None: """Unload the Heatmap cog.""" bot.remove_cog("Heatmap")
def teardown(bot: ButtercupBot) -> None: """Unload the Find cog.""" bot.remove_cog("Find")
def teardown(bot: ButtercupBot) -> None: """Unload the Welcome cog.""" bot.remove_cog("welcome")
def teardown(bot: ButtercupBot) -> None: """Unload the Queue cog.""" bot.remove_cog("Queue")
def teardown(bot: ButtercupBot) -> None: """Unload the Rules cog.""" bot.remove_cog("Rules")
def teardown(bot: ButtercupBot) -> None: """Unload the NameValidator cog.""" bot.remove_cog("NameValidator")
def setup(bot: ButtercupBot) -> None: """Set up the Handlers cog.""" bot.add_cog(Handlers())
def teardown(bot: ButtercupBot) -> None: """Unload the Ping cog.""" bot.remove_cog("Ping")
def teardown(bot: ButtercupBot) -> None: """Unload the Stats cog.""" bot.remove_cog("Stats")
import sys from buttercup import logger from buttercup.bot import ButtercupBot EXTENSIONS = [ # The config cog has to be first! "config", "admin", "handlers", "welcome", "name_validator", "find", "search", "stats", "heatmap", "history", "ping", "rules", "leaderboard", "queue", ] logger.configure_logging() config_path = sys.argv[1] if len(sys.argv) > 1 else "config.toml" bot = ButtercupBot(command_prefix="!", config_path=config_path, extensions=EXTENSIONS) bot.run(bot.config["Discord"]["token"])
def teardown(bot: ButtercupBot) -> None: """Unload the History cog.""" bot.remove_cog("History")
def setup(bot: ButtercupBot) -> None: """Set up the Admin cog.""" bot.add_cog(AdminCommands(bot))
def teardown(bot: ButtercupBot) -> None: """Unload the Admin cog.""" bot.remove_cog("AdminCommands")
def teardown(bot: ButtercupBot) -> None: """Unload the Handlers cog.""" bot.remove_cog("Handlers")
def setup(bot: ButtercupBot) -> None: """Set up the NameValidator cog.""" cog_config = bot.config["NameValidator"] verified_role_id = cog_config.get("verified_role_id") bot.add_cog(NameValidator(bot, verified_role_id))
def teardown(bot: ButtercupBot) -> None: """Unload the Leaderboard cog.""" bot.remove_cog("Leaderboard")