@@ -20,6 +20,7 @@ def type(self) -> str:
2020@dataclass
2121class CompatibleText (BaseElem ):
2222 """仅用于兼容性变更,不应作为判断条件"""
23+
2324 @property
2425 def text (self ) -> str :
2526 return self .display
@@ -28,6 +29,7 @@ def text(self) -> str:
2829 def text (self , text : str ):
2930 """ignore"""
3031
32+
3133@dataclass
3234class MediaInfo :
3335 name : str
@@ -215,9 +217,15 @@ def display(self) -> str:
215217 return f"[file:{ self .file_name } ]"
216218
217219 @classmethod
218- def _paste_build (cls , file_size : int , file_name : str ,
219- file_md5 : bytes , file_id : Optional [str ] = None ,
220- file_uuid : Optional [str ] = None , file_hash : Optional [str ] = None ) -> "File" :
220+ def _paste_build (
221+ cls ,
222+ file_size : int ,
223+ file_name : str ,
224+ file_md5 : bytes ,
225+ file_id : Optional [str ] = None ,
226+ file_uuid : Optional [str ] = None ,
227+ file_hash : Optional [str ] = None ,
228+ ) -> "File" :
221229 return cls (
222230 file_size = file_size ,
223231 file_name = file_name ,
@@ -244,8 +252,66 @@ class GreyTips(BaseElem):
244252 建议搭配Text使用
245253 冷却3分钟左右?
246254 """
255+
247256 text : str
248257
249258 @property
250259 def display (self ) -> str :
251260 return f"<GreyTips: { self .text } >"
261+
262+
263+ @dataclass
264+ class Markdown (BaseElem ):
265+ content : str
266+
267+ @property
268+ def display (self ) -> str :
269+ return f"[markdown:{ self .content } ]"
270+
271+
272+ class Permission :
273+ type : int
274+ specify_role_ids : Optional [list [str ]]
275+ specify_user_ids : Optional [list [str ]]
276+
277+
278+ class RenderData :
279+ label : Optional [str ]
280+ visited_label : Optional [str ]
281+ style : int
282+
283+
284+ class Action :
285+ type : Optional [int ]
286+ permission : Optional [Permission ]
287+ data : str
288+ reply : bool
289+ enter : bool
290+ anchor : Optional [int ]
291+ unsupport_tips : Optional [str ]
292+ click_limit : Optional [int ] # deprecated
293+ at_bot_show_channel_list : bool # deprecated
294+
295+
296+ class Button :
297+ id : Optional [str ]
298+ render_data : Optional [RenderData ]
299+ action : Optional [Action ]
300+
301+
302+ class InlineKeyboardRow :
303+ buttons : Optional [list [Button ]]
304+
305+
306+ class InlineKeyboard :
307+ rows : list [InlineKeyboardRow ]
308+
309+
310+ @dataclass
311+ class Keyboard (BaseElem ):
312+ content : Optional [list [InlineKeyboard ]]
313+ bot_appid : int
314+
315+ @property
316+ def display (self ) -> str :
317+ return f"[keyboard:{ self .bot_appid } ]"
0 commit comments