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