File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,4 +20,4 @@ class DiscordAdapterConfig(BaseModel):
2020 class DiscordMessage (Struct ):
2121 _ignore : str = ""
2222
23- mention_user_discord = lambda x : x # noqa: E731
23+ mention_user_discord = None
Original file line number Diff line number Diff line change @@ -21,4 +21,4 @@ class SlackAdapterConfig(BaseModel):
2121 class SlackMessage (Struct ):
2222 _ignore : str = ""
2323
24- mention_user_slack = lambda x : x # noqa: E731
24+ mention_user_slack = None
Original file line number Diff line number Diff line change @@ -24,4 +24,4 @@ class SymphonyAdapterConfig(BaseModel):
2424 class SymphonyMessage (Struct ):
2525 _ignore : str = ""
2626
27- mention_user_symphony = lambda x : x # noqa: E731
27+ mention_user_symphony = None
Original file line number Diff line number Diff line change @@ -56,12 +56,18 @@ def recursive_format_for_message_ml(d):
5656
5757def mention_user (email_or_userid : str = "" , backend : Backend = "symphony" ) -> str :
5858 if backend == "symphony" :
59+ if mention_user_symphony is None :
60+ raise ImportError ("Symphony adapter is not available." )
5961 return mention_user_symphony (email_or_userid )
6062 elif backend == "slack" :
6163 if not email_or_userid .startswith ("@" ):
6264 email_or_userid = f"@{ email_or_userid } "
65+ if mention_user_slack is None :
66+ raise ImportError ("Slack adapter is not available." )
6367 return mention_user_slack (email_or_userid )
6468 elif backend == "discord" :
69+ if mention_user_discord is None :
70+ raise ImportError ("Discord adapter is not available." )
6571 return mention_user_discord (email_or_userid )
6672 else :
6773 raise NotImplementedError (f"Unsupported backend: { backend } " )
You can’t perform that action at this time.
0 commit comments