示例#1
0
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))
示例#2
0
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))
示例#3
0
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))
示例#4
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the Heatmap cog."""
    bot.remove_cog("Heatmap")
示例#5
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the Find cog."""
    bot.remove_cog("Find")
示例#6
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the Welcome cog."""
    bot.remove_cog("welcome")
示例#7
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the Queue cog."""
    bot.remove_cog("Queue")
示例#8
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the Rules cog."""
    bot.remove_cog("Rules")
示例#9
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the NameValidator cog."""
    bot.remove_cog("NameValidator")
示例#10
0
def setup(bot: ButtercupBot) -> None:
    """Set up the Handlers cog."""
    bot.add_cog(Handlers())
示例#11
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the Ping cog."""
    bot.remove_cog("Ping")
示例#12
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the Stats cog."""
    bot.remove_cog("Stats")
示例#13
0
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"])
示例#14
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the History cog."""
    bot.remove_cog("History")
示例#15
0
def setup(bot: ButtercupBot) -> None:
    """Set up the Admin cog."""
    bot.add_cog(AdminCommands(bot))
示例#16
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the Admin cog."""
    bot.remove_cog("AdminCommands")
示例#17
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the Handlers cog."""
    bot.remove_cog("Handlers")
示例#18
0
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))
示例#19
0
def teardown(bot: ButtercupBot) -> None:
    """Unload the Leaderboard cog."""
    bot.remove_cog("Leaderboard")