diff options
author | 2022-08-21 22:12:24 +0100 | |
---|---|---|
committer | 2022-08-21 22:27:59 +0100 | |
commit | 2b63ccba96d8651f2ff7d43a5f10f95f2b154268 (patch) | |
tree | 099fdeab7d8bd4c188f186cac13bd2ea70fb3563 /arthur/extensions.py | |
parent | Bump Dockerfile and CI to Python 3.10 (diff) |
Use BotBase from bot-core
This includes:
- Moving to an async main function to start the bot
- Moving all extension loading (barring jishaku) to bot core
- Adding dunder init files to all packages, required by bot-core ext loaders
Diffstat (limited to 'arthur/extensions.py')
-rw-r--r-- | arthur/extensions.py | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/arthur/extensions.py b/arthur/extensions.py deleted file mode 100644 index 2170d68..0000000 --- a/arthur/extensions.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Utilities for working with extensions.""" -from pathlib import Path -from typing import Generator - - -def find_extensions() -> Generator[tuple[Path, str], None, None]: - """Search the exts directory to find cogs to load.""" - for path in Path("arthur/exts").rglob("**/*.py"): - # Convert a path like "arthur/exts/foo/bar.py" to "arthur.exts.foo.bar" - yield path, path_to_module(path) - - -def path_to_module(path: Path) -> str: - """Convert a path like "arthur/exts/foo/bar.py" to "arthur.exts.foo.bar".""" - return str(path.parent.as_posix()).replace("/", ".") + f".{path.stem}" |