mirror of https://github.com/coddrago/Heroku
feat: add enable_core_protection
parent
4ad4e0ca0b
commit
0a51dfd375
|
@ -154,9 +154,13 @@ heroku_settings:
|
|||
_cmd_doc_watchers: "Zeigt aktive Wächter an"
|
||||
_cmd_doc_weburl: "Öffnet einen Tunnel zur Hikka-Weboberfläche"
|
||||
core_protection_already_removed: "<emoji document_id=6003424016977628379>🔒</emoji> <b>Kernschutz wurde bereits entfernt</b>"
|
||||
core_protection_already_enabled: "<emoji document_id=6003424016977628379>🔒</emoji> <b>kernschutz wurde bereits installiert</b>"
|
||||
core_protection_confirm: "⚠️ <b>BITTE SORGFÄLTIG LESEN!</b>\n\nDurch das Entfernen des Kernschutzes bestätigst du, dass du weißt, was dies bedeutet und wofür es ist. Normalerweise benötigst du dies <b>nicht</b>. Wenn du kein Entwickler bist, benötigst du dies <b>nicht</b>. Wenn du unsicher bist, benötigst du dies <b>nicht</b>.\n\n<b>Bist du sicher, dass du den Kernschutz entfernen möchtest?</b>"
|
||||
core_protection_confirm_e: "⚠️ <b>BITTE SORGFÄLTIG LESEN!</b>\n\nDurch das installierst des Kernschutzes bestätigst du, dass du weißt, was dies bedeutet und wofür es ist. Normalerweise benötigst du dies <b>nicht</b>. Wenn du kein Entwickler bist, benötigst du dies <b>nicht</b>. Wenn du unsicher bist, benötigst du dies <b>nicht</b>.\n\n<b>Bist du sicher, dass du den Kernschutz installieren möchtest?</b>"
|
||||
core_protection_btn: "🔓 Kernschutz entfernen"
|
||||
core_protection_e_btn: "🔓 Kernschutz installieren"
|
||||
core_protection_removed: "🔓 <b>Kernschutz erfolgreich entfernt</b>"
|
||||
core_protection_enabled: "🔓 <b>Kernschutz erfolgreich installiert</b>"
|
||||
|
||||
terminal:
|
||||
fw_protect: "Verzögerung zwischen Bearbeitungen"
|
||||
|
|
|
@ -166,9 +166,13 @@ heroku_settings:
|
|||
_cmd_doc_weburl: "Opens web tunnel to your Heroku web interface"
|
||||
_cls_doc: "Advanced settings for Heroku Userbot"
|
||||
core_protection_already_removed: "<emoji document_id=6003424016977628379>🔒</emoji> <b>Core protection is already removed</b>"
|
||||
core_protection_already_enabled: "<emoji document_id=6003424016977628379>🔒</emoji> <b>Core protection is already set up</b>"
|
||||
core_protection_confirm: "⚠️ <b>READ CAREFULLY!</b>\n\nBy removing core protection you confirm, that you know what is it and what is it for. In common life scenario you <b>don't need it</b>. If you're not a developer, you <b>don't need it</b>. If you're not sure, you <b>don't need it</b>.\n\n<b>Are you sure you want to remove core protection?</b>"
|
||||
core_protection_confirm_e: "⚠️ <b>READ CAREFULLY!</b>\n\nBy restoring core protection you confirm, that you know what is it and what is it for. In common life scenario you <b>didn't need to remove it</b>. If you're not a developer, you <b>didn't need it</b>. If you're not sure, you <b>don't need it</b>.\n\n<b>Are you sure you want to restore core protection?</b>"
|
||||
core_protection_btn: "🔓 Remove core protection"
|
||||
core_protection_e_btn: "🔓 Restore core protection"
|
||||
core_protection_removed: "🔓 <b>Core protection removed successfully</b>"
|
||||
core_protection_enabled: "🔓 <b>Core protection enabled successfully</b>"
|
||||
|
||||
terminal:
|
||||
name: "Terminal"
|
||||
|
|
|
@ -154,9 +154,13 @@ heroku_settings:
|
|||
_cmd_doc_watchers: "Показать активные смотрители"
|
||||
_cmd_doc_weburl: "Открыть тоннель к веб-интерфейсу Heroku"
|
||||
core_protection_already_removed: "<emoji document_id=6003424016977628379>🔒</emoji> <b>Защита ядра уже удалена</b>"
|
||||
core_protection_already_enabled: "<emoji document_id=6003424016977628379>🔒</emoji> <b>Защита ядра уже установлена</b>"
|
||||
core_protection_confirm: "⚠️ <b>ВНИМАТЕЛЬНО ПРОЧТИТЕ!</b>\n\nУдаляя защиту ядра, вы подтверждаете, что знаете что это и для чего оно. В обычном сценарии жизни вам <b>не нужно</b>. Если вы не разработчик, вам <b>не нужно</b>. Если вы не уверены, вам <b>не нужно</b>.\n\n<b>Вы уверены, что хотите удалить защиту ядра?</b>"
|
||||
core_protection_confirm_e: "⚠️ <b>ВНИМАТЕЛЬНО ПРОЧТИТЕ!</b>\n\nВозвращая защиту ядра, вы подтверждаете, что знаете что это и для чего оно. В обычном сценарии жизни вам <b>не нужно было её удалять</b>. Если вы не разработчик, вам <b>не нужно было этого делать</b>. Если вы не уверены, вам <b>не нужно</b>.\n\n<b>Вы уверены, что хотите вернуть защиту ядра?</b>"
|
||||
core_protection_btn: "🔓 Удалить защиту ядра"
|
||||
core_protection_e_btn: "🔓 Установить защиту ядра"
|
||||
core_protection_removed: "🔓 <b>Защита ядра успешно удалена</b>"
|
||||
core_protection_enabled: "🔓 <b>Защита ядра успешно установлена</b>"
|
||||
|
||||
terminal:
|
||||
fw_protect: "Задержка между редактированиями"
|
||||
|
|
|
@ -154,9 +154,13 @@ heroku_settings:
|
|||
_cmd_doc_watchers: "Показати активних наглядачів"
|
||||
_cmd_doc_weburl: "Відкрити тунель до веб-інтерфейсу Heroku"
|
||||
core_protection_already_removed: "<emoji document_id=6003424016977628379>🔒</emoji> <b>Захист ядра вже видалено</b>"
|
||||
core_protection_already_enabled: "<emoji document_id=6003424016977628379>🔒</emoji> <b>Захист ядра вже встановлений</b>"
|
||||
core_protection_confirm: "⚠️ <b>УВАЖНО ПРОЧИТАТЙТЕ!</b>\n\nВидаляючи захист ядра, ви підтверджуєте, що знаєте що це і для чого воно. В звичайному сценарії життя вам <b>не треба</b>. Якщо ви не розробник, вам <b>не треба</b>. Якщо ви не впевнені, вам <b>не треба</b>.\n\n<b>Ви впевнені, що хочете видалити захист ядра?</b>"
|
||||
core_protection_confirm_e: "⚠️ <b>УВАЖНО ПРОЧИТАТЙТЕ!</b>\n\nВстановлюючи захист ядра, ви підтверджуєте, що знаєте що це і для чого воно. В звичайному сценарії життя вам <b>не треба</b>. Якщо ви не розробник, вам <b>не треба</b>. Якщо ви не впевнені, вам <b>не треба</b>.\n\n<b>Ви впевнені, що хочете встановити захист ядра?</b>"
|
||||
core_protection_btn: "🔓 Видалити захист ядра"
|
||||
core_protection_e_btn: "🔓 Встановити захист ядра"
|
||||
core_protection_removed: "🔓 <b>Захист ядра успішно видалений</b>"
|
||||
core_protection_enabled: "🔓 <b>Захист ядра успішно встановлено</b>"
|
||||
|
||||
terminal:
|
||||
fw_protect: "Затримка між редагуваннями"
|
||||
|
|
|
@ -528,6 +528,31 @@ class HerokuSettingsMod(loader.Module):
|
|||
],
|
||||
)
|
||||
|
||||
async def _enable_core_protection(self, call: InlineCall):
|
||||
self._db.set(main.__name__, "remove_core_protection", False)
|
||||
await call.edit(self.strings("core_protection_enabled"))
|
||||
|
||||
@loader.command()
|
||||
async def enable_core_protection(self, message: Message):
|
||||
if self._db.get(main.__name__, "remove_core_protection", True):
|
||||
await utils.answer(message, self.strings("core_protection_already_enabled"))
|
||||
return
|
||||
|
||||
await self.inline.form(
|
||||
message=message,
|
||||
text=self.strings("core_protection_confirm_e"),
|
||||
reply_markup=[
|
||||
{
|
||||
"text": self.strings("core_protection_e_btn"),
|
||||
"callback": self._enable_core_protection,
|
||||
},
|
||||
{
|
||||
"text": self.strings("btn_no"),
|
||||
"action": "close",
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
async def inline__restart(
|
||||
self,
|
||||
call: InlineCall,
|
||||
|
|
Loading…
Reference in New Issue