hawking.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:hawking 作者: naschorr 项目源码 文件源码
def __init__(self, **kwargs):
        self.activation_str = kwargs.get(self.ACTIVATION_STR_KEY, self.ACTIVATION_STR)
        self.description = kwargs.get(self.DESCRIPTION_KEY, self.DESCRIPTION)
        self.token_file_path = kwargs.get(self.TOKEN_FILE_PATH_KEY, self.TOKEN_FILE_PATH)
        ## Todo: pass kwargs to the their modules

        ## Init the bot and module manager
        self.bot = commands.Bot(
            command_prefix=commands.when_mentioned_or(self.activation_str),
            description=self.description
        )
        self.module_manager = ModuleManager(self, self.bot)

        ## Register the modules (Order of registration is important, make sure dependancies are loaded first)
        self.module_manager.register(speech.Speech, *[self.bot])
        self.module_manager.register(phrases.Phrases, *[self, self.bot],
                                     **dict(pass_context=True, no_pm=True))
        self.module_manager.register(music.Music, *[self, self.bot])
        self.module_manager.register(admin.Admin, *[self, self.bot])

        ## Give some feedback for when the bot is ready to go
        @self.bot.event
        async def on_ready():
            print("Logged in as '{}' (version: {}), (id: {})".format(self.bot.user.name, self.VERSION, self.bot.user.id))

    ## Methods

    ## Add an arbitary cog to the bot
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号