Skip to content

Commit f97ae67

Browse files
authored
Traduzione modulo log_channel
Traduzione modulo log_channel come richhiesto qui #11
1 parent 1ce20de commit f97ae67

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

tg_bot/modules/log_channel.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ def log_action(bot: Bot, update: Update, *args, **kwargs):
2525
if result:
2626
if chat.type == chat.SUPERGROUP and chat.username:
2727
result += "\n<b>Link:</b> " \
28-
"<a href=\"http://telegram.me/{}/{}\">click here</a>".format(chat.username,
28+
"<a href=\"http://telegram.me/{}/{}\">Fai click qui</a>".format(chat.username,
2929
message.message_id)
3030
log_chat = sql.get_chat_log_channel(chat.id)
3131
if log_chat:
3232
send_log(bot, log_chat, chat.id, result)
3333
elif result == "":
3434
pass
3535
else:
36-
LOGGER.warning("%s was set as loggable, but had no return statement.", func)
36+
LOGGER.warning("%s è stato impostato come loggable, ma non ha nessun return abilitato.", func)
3737

3838
return result
3939

@@ -67,14 +67,14 @@ def send_log(bot: Bot, log_chat_id: str, orig_chat_id: str, result: str):
6767
bot.send_message(log_chat_id, result, parse_mode=ParseMode.HTML)
6868
except BadRequest as excp:
6969
if excp.message == "Chat not found":
70-
bot.send_message(orig_chat_id, "This log channel has been deleted - unsetting.")
70+
bot.send_message(orig_chat_id, "Questo logchannel è stato cancellato - disattivamento.")
7171
sql.stop_chat_logging(orig_chat_id)
7272
else:
7373
LOGGER.warning(excp.message)
7474
LOGGER.warning(result)
7575
LOGGER.exception("Could not parse")
7676

77-
bot.send_message(log_chat_id, result + "\n\nFormatting has been disabled due to an unexpected error.")
77+
bot.send_message(log_chat_id, result + "\n\nFormattazione disattivata a causa di un errore sconosciuto.")
7878

7979

8080
@run_async
@@ -87,12 +87,12 @@ def logging(bot: Bot, update: Update):
8787
if log_channel:
8888
log_channel_info = bot.get_chat(log_channel)
8989
message.reply_text(
90-
"This group has all it's logs sent to: {} (`{}`)".format(escape_markdown(log_channel_info.title),
90+
"Questo gruppo ha impostato questo canale come log-channel: {} (`{}`)".format(escape_markdown(log_channel_info.title),
9191
log_channel),
9292
parse_mode=ParseMode.MARKDOWN)
9393

9494
else:
95-
message.reply_text("No log channel has been set for this group!")
95+
message.reply_text("Nessun log-channel è stato impostato per questo gruppo")
9696

9797

9898
@run_async
@@ -101,7 +101,7 @@ def setlog(bot: Bot, update: Update):
101101
message = update.effective_message # type: Optional[Message]
102102
chat = update.effective_chat # type: Optional[Chat]
103103
if chat.type == chat.CHANNEL:
104-
message.reply_text("Now, forward the /setlog to the group you want to tie this channel to!")
104+
message.reply_text("Ora, inoltra il /setlog al gruppo che vuoi collegare a questo canale.")
105105

106106
elif message.forward_from_chat:
107107
sql.set_chat_log_channel(chat.id, message.forward_from_chat.id)
@@ -115,21 +115,21 @@ def setlog(bot: Bot, update: Update):
115115

116116
try:
117117
bot.send_message(message.forward_from_chat.id,
118-
"This channel has been set as the log channel for {}.".format(
118+
"Il log-channel di questo gruppo è impostato a: {}.".format(
119119
chat.title or chat.first_name))
120120
except Unauthorized as excp:
121121
if excp.message == "Forbidden: bot is not a member of the channel chat":
122-
bot.send_message(chat.id, "Successfully set log channel!")
122+
bot.send_message(chat.id, "log-channel impostato correttamente!")
123123
else:
124124
LOGGER.exception("ERROR in setting the log channel.")
125125

126-
bot.send_message(chat.id, "Successfully set log channel!")
126+
bot.send_message(chat.id, "log-channel impostato correttamente!")
127127

128128
else:
129-
message.reply_text("The steps to set a log channel are:\n"
130-
" - add bot to the desired channel\n"
131-
" - send /setlog to the channel\n"
132-
" - forward the /setlog to the group\n")
129+
message.reply_text("Segui i seguenti passi per creare il log-channel:\n"
130+
" - aggiungi il bot al canale di log\n"
131+
" - invia /setlog nel canale\n"
132+
" - inoltra /setlog al gruppo che vuoi loggare\n")
133133

134134

135135
@run_async
@@ -140,15 +140,15 @@ def unsetlog(bot: Bot, update: Update):
140140

141141
log_channel = sql.stop_chat_logging(chat.id)
142142
if log_channel:
143-
bot.send_message(log_channel, "Channel has been unlinked from {}".format(chat.title))
144-
message.reply_text("Log channel has been un-set.")
143+
bot.send_message(log_channel, "Questo canale è stato scollegato da {}".format(chat.title))
144+
message.reply_text("Log channel è stato disattivato.")
145145

146146
else:
147-
message.reply_text("No log channel has been set yet!")
147+
message.reply_text("Nessun log-channel è stato ancora collegato!")
148148

149149

150150
def __stats__():
151-
return "{} log channels set.".format(sql.num_logchannels())
151+
return "{} log-channel impostato.".format(sql.num_logchannels())
152152

153153

154154
def __migrate__(old_chat_id, new_chat_id):
@@ -159,9 +159,9 @@ def __chat_settings__(chat_id, user_id):
159159
log_channel = sql.get_chat_log_channel(chat_id)
160160
if log_channel:
161161
log_channel_info = dispatcher.bot.get_chat(log_channel)
162-
return "This group has all it's logs sent to: {} (`{}`)".format(escape_markdown(log_channel_info.title),
162+
return "Questo gruppo è loggato qui: {} (`{}`)".format(escape_markdown(log_channel_info.title),
163163
log_channel)
164-
return "No log channel is set for this group!"
164+
return "Nessun log-channel è stato impostato per il gruppo!"
165165

166166

167167
__help__ = """

0 commit comments

Comments
 (0)