Move type definition

This commit is contained in:
Nexus 2024-09-19 17:41:54 +01:00
parent 46b7252fc3
commit 099465ad5f

View file

@ -3,7 +3,7 @@ import json
import logging import logging
import re import re
import typing import typing
from typing import Annotated from typing import Annotated, TYPE_CHECKING
import httpx import httpx
from pathlib import Path from pathlib import Path
@ -14,11 +14,12 @@ if typing.TYPE_CHECKING:
class MSCGetter(niobot.Module): class MSCGetter(niobot.Module):
bot: "NonsenseBot"
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
def __init__(self, bot): def __init__(self, bot):
super().__init__(bot) super().__init__(bot)
if TYPE_CHECKING:
self.bot: "NonsenseBot"
self.latest_msc = None self.latest_msc = None
self.msc_cache = Path.cwd() / ".msc-cache" self.msc_cache = Path.cwd() / ".msc-cache"
self.msc_cache.mkdir(parents=True, exist_ok=True) self.msc_cache.mkdir(parents=True, exist_ok=True)