more type checking imports

This commit is contained in:
sneakers-the-rat 2023-10-16 16:41:23 -07:00
parent ae4d610754
commit b4fd7c2080

View file

@ -13,11 +13,19 @@ from wiki_postbot.actions import Result
from wiki_postbot.logger import init_logger
from datetime import datetime
import requests
from discord.message import Message, Embed
import pdb
if TYPE_CHECKING:
try:
from wiki_postbot.clients.slack import SlackMessage
except ImportError:
SlackMessage = None
try:
from discord.message import Message, Embed
except ImportError:
Message = None
Embed = None
# creds = Mediawiki_Creds.from_json('mediawiki_creds.json')
@ -153,7 +161,7 @@ class Wiki:
)
return result
def handle_discord(self, msg:Message) -> Result:
def handle_discord(self, msg:'Message') -> Result:
"""
Not being precious about this, just implementing
and will worry about generality later!