@@ -1084,8 +1084,8 @@ def __init__(
1084
1084
title : str ,
1085
1085
content : str ,
1086
1086
message : Message ,
1087
- topic_links : Dict [str , Tuple [str , int , bool ]],
1088
- message_links : Dict [str , Tuple [str , int , bool ]],
1087
+ topic_links : Dict [str , Tuple [str , int , bool , bool ]],
1088
+ message_links : Dict [str , Tuple [str , int , bool , bool ]],
1089
1089
time_mentions : List [Tuple [str , str ]],
1090
1090
spoilers : List [Tuple [int , List [Any ], List [Any ]]],
1091
1091
) -> None :
@@ -1609,8 +1609,8 @@ def __init__(
1609
1609
controller : Any ,
1610
1610
msg : Message ,
1611
1611
title : str ,
1612
- topic_links : Dict [str , Tuple [str , int , bool ]],
1613
- message_links : Dict [str , Tuple [str , int , bool ]],
1612
+ topic_links : Dict [str , Tuple [str , int , bool , bool ]],
1613
+ message_links : Dict [str , Tuple [str , int , bool , bool ]],
1614
1614
time_mentions : List [Tuple [str , str ]],
1615
1615
spoilers : List [Tuple [int , List [Any ], List [Any ]]],
1616
1616
) -> None :
@@ -1748,17 +1748,21 @@ def __init__(
1748
1748
1749
1749
@staticmethod
1750
1750
def create_link_buttons (
1751
- controller : Any , links : Dict [str , Tuple [str , int , bool ]]
1751
+ controller : Any , links : Dict [str , Tuple [str , int , bool , bool ]]
1752
1752
) -> Tuple [List [MessageLinkButton ], int ]:
1753
1753
link_widgets = []
1754
1754
link_width = 0
1755
1755
1756
1756
for index , link in enumerate (links ):
1757
- text , link_index , _ = links [link ]
1757
+ text , link_index , _ , spoiler_link = links [link ]
1758
1758
if text :
1759
1759
caption = f"{ link_index } : { text } \n { link } "
1760
+ if spoiler_link :
1761
+ caption = f"{ link_index } [spoiler]: { text } \n { link } "
1760
1762
else :
1761
1763
caption = f"{ link_index } : { link } "
1764
+ if spoiler_link :
1765
+ caption = f"{ link_index } [spoiler]: { link } "
1762
1766
link_width = max (link_width , len (max (caption .split ("\n " ), key = len )))
1763
1767
1764
1768
display_attr = None if index % 2 else "popup_contrast"
@@ -1884,8 +1888,8 @@ def __init__(
1884
1888
self ,
1885
1889
controller : Any ,
1886
1890
message : Message ,
1887
- topic_links : Dict [str , Tuple [str , int , bool ]],
1888
- message_links : Dict [str , Tuple [str , int , bool ]],
1891
+ topic_links : Dict [str , Tuple [str , int , bool , bool ]],
1892
+ message_links : Dict [str , Tuple [str , int , bool , bool ]],
1889
1893
time_mentions : List [Tuple [str , str ]],
1890
1894
spoilers : List [Tuple [int , List [Any ], List [Any ]]],
1891
1895
title : str ,
@@ -2005,8 +2009,8 @@ def __init__(
2005
2009
self ,
2006
2010
controller : Any ,
2007
2011
message : Message ,
2008
- topic_links : Dict [str , Tuple [str , int , bool ]],
2009
- message_links : Dict [str , Tuple [str , int , bool ]],
2012
+ topic_links : Dict [str , Tuple [str , int , bool , bool ]],
2013
+ message_links : Dict [str , Tuple [str , int , bool , bool ]],
2010
2014
time_mentions : List [Tuple [str , str ]],
2011
2015
spoilers : List [Tuple [int , List [Any ], List [Any ]]],
2012
2016
title : str ,
@@ -2052,8 +2056,8 @@ def __init__(
2052
2056
self ,
2053
2057
controller : Any ,
2054
2058
message : Message ,
2055
- topic_links : Dict [str , Tuple [str , int , bool ]],
2056
- message_links : Dict [str , Tuple [str , int , bool ]],
2059
+ topic_links : Dict [str , Tuple [str , int , bool , bool ]],
2060
+ message_links : Dict [str , Tuple [str , int , bool , bool ]],
2057
2061
time_mentions : List [Tuple [str , str ]],
2058
2062
spoilers : List [Tuple [int , List [Any ], List [Any ]]],
2059
2063
title : str ,
0 commit comments