22
33from typing import TYPE_CHECKING
44
5- from bot .ext import Admonitions , CommandExemples , Response , TBase , TranslationBase
5+ from bot .ext import Response , TBase , TranslationBase
66
77if TYPE_CHECKING :
88 from bot .bot import Gorenmu
@@ -18,52 +18,43 @@ class Shorten(TBase):
1818 def __init__ (self ):
1919 super ().__init__ ()
2020
21- def placeholder (self , ctx : Context , * args ) -> Response :
21+ def api_erro (self , ctx : Context ) -> Response :
2222 response = Response (ctx = ctx , success = False , handle = None , response_list = None )
2323 with self .lang_dict .once (self ._cname ):
24- self .lang_dict .add_with ("en" , "" )
25- self .lang_dict .add_with (["pt_br" , "pt" ], "" )
26- return response .format_response (self ._untangle_str (ctx , self ._cname ), args )
24+ self .lang_dict .add_with ("en" , "The shortener API is currently experiencing issues. " )
25+ self .lang_dict .add_with (["pt_br" , "pt" ], "A API do encurtador apresentando problemas no momento. " )
26+ return response .format_response (self ._untangle_str (ctx , self ._cname ))
2727
28- def placeholder2 (self , ctx : Context , * args ) -> Response :
29- response = Response (ctx = ctx , success = False , handle = None , response_list = None )
28+ def urls (self , ctx : Context , urls ) -> Response :
29+ response = Response (ctx = ctx , success = True , handle = None , response_list = None )
30+ with self .lang_dict .once (self ._cname ):
31+ self .lang_dict .add_with ("en" , "Here are all the URLs: {}" )
32+ self .lang_dict .add_with (["pt_br" , "pt" ], "Aqui estão todos os URLs: {}" )
33+ return response .format_response (self ._untangle_str (ctx , self ._cname ), urls )
34+
35+ def url (self , ctx : Context , url ) -> Response :
36+ response = Response (ctx = ctx , success = True , handle = None , response_list = None )
3037 with self .lang_dict .once (self ._cname ):
31- self .lang_dict .add_with ("en" , "" )
32- self .lang_dict .add_with (["pt_br" , "pt" ], "" )
33- return response .format_response (self ._untangle_str (ctx , self ._cname ), args )
38+ self .lang_dict .add_with ("en" , "Here is the URL: {} " )
39+ self .lang_dict .add_with (["pt_br" , "pt" ], "Aqui está URL: {} " )
40+ return response .format_response (self ._untangle_str (ctx , self ._cname ), url )
3441
3542 def deco_helper (self , ctx : Context , * args , ** kwargs ) -> str :
3643 with self .lang_dict .once (self ._cname ):
37- self .lang_dict .add_with ("en" , "" )
38- self .lang_dict .add_with (["pt_br" , "pt" ], "" )
44+ self .lang_dict .add_with ("en" , "Shorten links using my link shortening service. " )
45+ self .lang_dict .add_with (["pt_br" , "pt" ], "Encurta links usando o meu serviço de encurtar links. " )
3946 return self ._untangle_str (ctx , self ._cname )
4047
4148 def deco_usage (self , ctx : Context , prefix : str | None = None , * args , ** kwargs ) -> str :
4249 with self .lang_dict .once (self ._cname ):
43- self .lang_dict .add_with ("en" , "" )
44- self .lang_dict .add_with (["pt_br" , "pt" ], "" )
50+ self .lang_dict .add_with ("en" , "To use: {}shorten (links) " )
51+ self .lang_dict .add_with (["pt_br" , "pt" ], "Para usar: {}shorten (links) " )
4552 return self ._untangle_str (ctx , self ._cname ).format (prefix )
4653
47- # region Hide.
48-
4954 def deco_description (self , ctx : Context , * args , ** kwargs ) -> str :
5055 with self .lang_dict .once (self ._cname ):
51- self .lang_dict .add_with ("en" , "" )
52- self .lang_dict .add_with (["pt_br" , "pt" ], "" )
56+ self .lang_dict .add_with ("en" , "Shorten links using my link shortening service. " )
57+ self .lang_dict .add_with (["pt_br" , "pt" ], "Encurta links usando o meu serviço de encurtar links. " )
5358 return self ._untangle_str (ctx , self ._cname )
5459
55- def deco_commands (self , ctx : Context , * args , ** kwargs ) -> CommandExemples :
56- with self .lang_dict .once (self ._cname ):
57- self .lang_dict .add_with ("en" , CommandExemples ([]))
58- self .lang_dict .add_with (["pt_br" , "pt" ], CommandExemples ([]))
59- return self ._untangle_commands (ctx , self ._cname )
60-
61- def deco_admonitions (self , ctx : Context , * args , ** kwargs ) -> Admonitions :
62- with self .lang_dict .once (self ._cname ):
63- self .lang_dict .add_with ("en" , Admonitions ([]))
64- self .lang_dict .add_with (["pt_br" , "pt" ], Admonitions ([]))
65- return self ._untangle_admonitions (ctx , self ._cname )
66-
67- # endregion
68-
6960 Shorten : Shorten
0 commit comments