diff --git a/wiki_postbot/interfaces/mediawiki.py b/wiki_postbot/interfaces/mediawiki.py index b276eba..490e3d0 100644 --- a/wiki_postbot/interfaces/mediawiki.py +++ b/wiki_postbot/interfaces/mediawiki.py @@ -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: - 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') @@ -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!