1818from tg_bot .modules .sql import cust_filters_sql as sql
1919
2020HANDLER_GROUP = 10
21- BASIC_FILTER_STRING = "*Filters in this chat:*\n "
21+ BASIC_FILTER_STRING = "*Filtri in questa chat:*\n "
2222
2323
2424@run_async
@@ -27,7 +27,7 @@ def list_handlers(bot: Bot, update: Update):
2727 all_handlers = sql .get_chat_triggers (chat .id )
2828
2929 if not all_handlers :
30- update .effective_message .reply_text ("No filters are active here !" )
30+ update .effective_message .reply_text ("Nessun filtro attivo !" )
3131 return
3232
3333 filter_list = BASIC_FILTER_STRING
@@ -73,7 +73,7 @@ def filters(bot: Bot, update: Update):
7373 content , buttons = button_markdown_parser (extracted [1 ], entities = msg .parse_entities (), offset = offset )
7474 content = content .strip ()
7575 if not content :
76- msg .reply_text ("There is no note message - You can't JUST have buttons, you need a message to go with it !" )
76+ msg .reply_text ("Non c'è un messaggio di nota - Non puoi avere solo bottoni, hai bisogno di accompagnarli con un messaggio !" )
7777 return
7878
7979 elif msg .reply_to_message and msg .reply_to_message .sticker :
@@ -101,7 +101,7 @@ def filters(bot: Bot, update: Update):
101101 is_video = True
102102
103103 else :
104- msg .reply_text ("You didn't specify what to reply with !" )
104+ msg .reply_text ("Non hai specificato con cosa rispondere !" )
105105 return
106106
107107 # Add the filter
@@ -113,7 +113,7 @@ def filters(bot: Bot, update: Update):
113113 sql .add_filter (chat .id , keyword , content , is_sticker , is_document , is_image , is_audio , is_voice , is_video ,
114114 buttons )
115115
116- msg .reply_text ("Handler ' {}' added !" .format (keyword ))
116+ msg .reply_text ("Aggiunto l'handler ' {}'!" .format (keyword ))
117117 raise DispatcherHandlerStop
118118
119119
@@ -129,16 +129,16 @@ def stop_filter(bot: Bot, update: Update):
129129 chat_filters = sql .get_chat_triggers (chat .id )
130130
131131 if not chat_filters :
132- update .effective_message .reply_text ("No filters are active here !" )
132+ update .effective_message .reply_text ("Nessun filtro attivo !" )
133133 return
134134
135135 for keyword in chat_filters :
136136 if keyword == args [1 ]:
137137 sql .remove_filter (chat .id , args [1 ])
138- update .effective_message .reply_text ("Yep, I'll stop replying to that ." )
138+ update .effective_message .reply_text ("Sì, smetterò di rispondere a questo ." )
139139 raise DispatcherHandlerStop
140140
141- update .effective_message .reply_text ("That's not a current filter - run /filters for all active filters ." )
141+ update .effective_message .reply_text ("Questo attualmente non è un filtro - esegui /filters per tutti i filtri attivi ." )
142142
143143
144144@run_async
@@ -177,16 +177,16 @@ def reply_filter(bot: Bot, update: Update):
177177 reply_markup = keyboard )
178178 except BadRequest as excp :
179179 if excp .message == "Unsupported url protocol" :
180- message .reply_text ("You seem to be trying to use an unsupported url protocol. Telegram "
181- "doesn't support buttons for some protocols, such as tg://. Please try "
182- "again, or ask in @MarieSupport for help ." )
180+ message .reply_text ("Sembra che tu stia provando a usare un protocollo url non supportato. "
181+ "Telegram non supporta i bottoni con alcuni procolli come per esempio: tg://."
182+ "Per favore riprova oppure chiedi aiuto qui: @MarieSupport ." )
183183 elif excp .message == "Reply message not found" :
184184 bot .send_message (chat .id , filt .reply , parse_mode = ParseMode .MARKDOWN ,
185185 disable_web_page_preview = True ,
186186 reply_markup = keyboard )
187187 else :
188- message .reply_text ("This note could not be sent, as it is incorrectly formatted. Ask in "
189- "@MarieSupport if you can't figure out why! " )
188+ message .reply_text ("Questa nota non può essere inviata, è formattata in modo scorretto. "
189+ "Chiedi su @MarieSupport se non riesci a capire perché. " )
190190 LOGGER .warning ("Message %s could not be parsed" , str (filt .reply ))
191191 LOGGER .exception ("Could not parse filter %s in chat %s" , str (filt .keyword ), str (chat .id ))
192192
@@ -197,7 +197,7 @@ def reply_filter(bot: Bot, update: Update):
197197
198198
199199def __stats__ ():
200- return "{} filters, across {} chats ." .format (sql .num_filters (), sql .num_chats ())
200+ return "{} filtri, in {} chat ." .format (sql .num_filters (), sql .num_chats ())
201201
202202
203203def __migrate__ (old_chat_id , new_chat_id ):
@@ -206,18 +206,18 @@ def __migrate__(old_chat_id, new_chat_id):
206206
207207def __chat_settings__ (chat_id , user_id ):
208208 cust_filters = sql .get_chat_triggers (chat_id )
209- return "There are `{}` custom filters here ." .format (len (cust_filters ))
209+ return "Ci sono `{}` filtri personalizzati ." .format (len (cust_filters ))
210210
211211
212212__help__ = """
213- - /filters: list all active filters in this chat.
213+ - /filters: mostra la lista di tutti i filtri attivi in questa chat.
214214
215- *Admin only :*
216- - /filter <keyword> <reply message>: add a filter to this chat. The bot will now reply that message whenever 'keyword'\
217- is mentioned. If you reply to a sticker with a keyword, the bot will reply with that sticker. NOTE: all filter \
218- keywords are in lowercase. If you want your keyword to be a sentence, use quotes . eg: /filter "hey there" How you \
215+ *Solo admin :*
216+ - /filter <keyword> <reply message>: aggiunge un filtro a questa chat. Il bot ora risponderà ogni volta che 'keyword'\
217+ viene menzionata. Se si risponde ad uno sticker con una parola chiave, il bot risponderà con quello sticker. NOTE: tutte le \
218+ parole chiave sono in minuscolo. Se si vuole che la parola chiave sia una frase basta usare le virgolette . eg: /filter "hey there" How you \
219219 doin?
220- - /stop <filter keyword>: stop that filter .
220+ - /stop <filter keyword>: rimuove quel filtro .
221221"""
222222
223223__mod_name__ = "Filters"
0 commit comments