Edit on GitHub

tickets_plus.cogs

An import utility for loading all cogs in this submodule.

This file just makes it easier to load all cogs in this submodule. We can just import this submodule and iterate over the EXTENSIONS list.

Typical usage example:
from tickets_plus import bot
from tickets_plus import cogs
bot_instance = bot.TicketsPlusBot(...)
for extension in cogs.EXTENSIONS:
    await bot_instance.load_extension(extension)
 1"""An import utility for loading all cogs in this submodule.
 2
 3This file just makes it easier to load all cogs in this submodule.
 4We can just import this submodule and iterate over the `EXTENSIONS` list.
 5
 6Typical usage example:
 7    ```py
 8    from tickets_plus import bot
 9    from tickets_plus import cogs
10    bot_instance = bot.TicketsPlusBot(...)
11    for extension in cogs.EXTENSIONS:
12        await bot_instance.load_extension(extension)
13    ```
14"""
15# License: EPL-2.0
16# SPDX-License-Identifier: EPL-2.0
17# Copyright (c) 2021-present The Tickets+ Contributors
18# This Source Code may also be made available under the following
19# Secondary Licenses when the conditions for such availability set forth
20# in the Eclipse Public License, v. 2.0 are satisfied: GPL-3.0-only OR
21# If later approved by the Initial Contributor, GPL-3.0-or-later.
22
23import pkgutil
24
25EXTENSIONS = [module.name for module in pkgutil.iter_modules(__path__, f"{__package__}.")]
26"""A list of all cogs in this submodule. This is the list of cogs to load."""

A list of all cogs in this submodule. This is the list of cogs to load.