update installationcmd

pull/85/head
Rilliat 2025-02-03 08:19:28 +03:00
parent 1736e66ca2
commit 67d9c81f5c
6 changed files with 48 additions and 14 deletions

View File

@ -247,7 +247,7 @@ settings:
_cmd_doc_blacklistuser: "[Benutzer] - Verhindert, dass ein Benutzer Befehle ausführt"
_cmd_doc_cleardb: "Löscht die Datenbank"
_cmd_doc_delalias: "Entfernt einen Alias für einen Befehl"
_cmd_doc_hikka: "Zeigt die Version von Hikka an"
_cmd_doc_heroku: "Zeigt die Version von Hikka an"
_cmd_doc_setprefix: "<Präfix> - Setzt den Befehlspräfix"
_cmd_doc_unblacklist: "[Chat] - Aktiviert den Bot an einem bestimmten Ort"
_cmd_doc_unblacklistuser: "[Benutzer] - Erlaubt einem Benutzer, Befehle auszuführen"

View File

@ -159,7 +159,7 @@ heroku_settings:
_cmd_doc_nonickuser: "Allow no nickname for certain user"
_cmd_doc_nonickusers: "Returns the list of NoNick users"
_cmd_doc_settings: "Show settings menu"
_cmd_doc_uninstall_hikka: "Uninstall Heroku"
_cmd_doc_uninstall_heroku: "Uninstall Heroku"
_cmd_doc_watcherbl: "<module> - Toggle watcher in current chat"
_cmd_doc_watcher: "<module> - Toggle global watcher rules\nArgs:\n[-c - only in chats]\n[-p - only in pm]\n[-o - only out]\n[-i - only incoming]"
_cmd_doc_watchers: "List current watchers"
@ -229,14 +229,21 @@ presets:
settings:
name: "Settings"
choose_installation: ""
'jamhost', 'module_switch', 'userland' }
termux: "🕶 Termux"
vds: "💎 VDS"
railway: "🚂 Railway"
jamhost: "🧃 JamHost"
module_switch: "📁 Module Switching"
userland: "🐧 UserLand"
choose_installation: "<emoji document_id=5363805650327450240>🪐</emoji><b> Choose your {heroku} installation option:</b>"
installation: "<emoji document_id=5363805650327450240>▪️</emoji> The installation is very easy! Just enter the following in your servers terminal:\n<pre><code class=\"language-bash\">sudo apt update &amp;&amp; sudo apt upgrade -y &amp;&amp; sudo apt install git &amp;&amp; sudo apt install python3-pip &amp;&amp; git clone https://github.com/coddrago/Heroku &amp;&amp; cd Heroku &amp;&amp; pip install -r requirements.txt &amp;&amp; python3 -m hikka</code></pre>\n<emoji document_id=5299027123913105700>😐</emoji> If you dont have sudo access, simply remove the initial steps.\n\n<emoji document_id=5300777464820145682>🥳</emoji> Lets go over a few arguments:\n\n<emoji document_id=5787313834012184077>🔐</emoji> The <code>--root</code> argument allows you to run Heroku as a <b>root user</b>.\n\n<emoji document_id=5785209342986817408>🌎</emoji> The <code>--no-web</code> argument enables login to your account <b>directly in the terminal, rather than through a link</b> <code>{}.lhr.life</code>.\n\n<emoji document_id=5471895949804575096>🤲</emoji> However, if you want to migrate from hikariatama Hikka, download this module:\n<pre><code class=\"language-heroku\">{prefix}dlm https://raw.githubusercontent.com/coddrago/modules/main/SwitchToHeroku.py</code></pre>\nIt completely safe and will help you upgrade to Heroku automatically"
termux_install: "😲 <b>How to install Heroku on Termux?</b>\n⬜ <b>Download Termux from</b> <a href="https://f-droid.org/repo/com.termux_118.apk">the link</a> <b>. ⚠️ The version from Play Market will not work!</b>\n⬜ <b>Copy the command into it:</b> <code>termux-wake-lock &amp;&amp; export AIOHTTP_NO_EXTENSIONS=1 &amp;&amp; pkg upgr -y &amp;&amp; pkg install tur-repo &amp;&amp; pkg update &amp;&amp; pkg install python3.10 &amp;&amp; pkg i wget ncurses-utils python3.10 -y &amp;&amp; pkg update &amp;&amp; pkg install openssl -y &amp;&amp; pkg install git &amp;&amp; clear &amp;&amp; git clone https://github.com/coddrago/Heroku &amp;&amp; cd Heroku &amp;&amp; pip install -r requirements.txt &amp;&amp; python3.10 -m hikka --no-web</code>\n⬜ <b>Answer "y" to everything the script asks</b>\n⬜ <b>Follow the instructions in the script.</b>\n\n⬜ <b>Where to get API_ID and API_HASH?</b> 🎬 <a href="https://youtu.be/DcqDA249Lhg?t=24">Video</a>"
vds_install: "<pre><code class="language-bash">sudo apt update &amp;&amp; sudo apt upgrade -y &amp;&amp; sudo apt install git &amp;&amp; sudo apt install python3-pip &amp;&amp; git clone https://github.com/coddrago/Heroku &amp;&amp; cd Heroku &amp;&amp; pip install -r requirements.txt &amp;&amp; python3 -m hikka</code></pre>"
termux_install: "😲 <b>How to install Heroku on Termux?</b>\n⬜ <b>Download Termux from</b> <a href=\"https://f-droid.org/repo/com.termux_118.apk\">the link</a> <b>. ⚠️ The version from Play Market will not work!</b>\n⬜ <b>Copy the command into it:</b> <code>termux-wake-lock &amp;&amp; export AIOHTTP_NO_EXTENSIONS=1 &amp;&amp; pkg upgr -y &amp;&amp; pkg install tur-repo &amp;&amp; pkg update &amp;&amp; pkg install python3.10 &amp;&amp; pkg i wget ncurses-utils python3.10 -y &amp;&amp; pkg update &amp;&amp; pkg install openssl -y &amp;&amp; pkg install git &amp;&amp; clear &amp;&amp; git clone https://github.com/coddrago/Heroku &amp;&amp; cd Heroku &amp;&amp; pip install -r requirements.txt &amp;&amp; python3.10 -m hikka --no-web</code>\n⬜ <b>Answer \"y\" to everything the script asks</b>\n⬜ <b>Follow the instructions in the script.</b>\n\n⬜ <b>Where to get API_ID and API_HASH?</b> 🎬 <a href=\"https://youtu.be/DcqDA249Lhg?t=24\">Video</a>"
vds_install: "<pre><code class=\"language-bash\">sudo apt update &amp;&amp; sudo apt upgrade -y &amp;&amp; sudo apt install git &amp;&amp; sudo apt install python3-pip &amp;&amp; git clone https://github.com/coddrago/Heroku &amp;&amp; cd Heroku &amp;&amp; pip install -r requirements.txt &amp;&amp; python3 -m hikka</code></pre>"
railway_install: "Image for RailWay:\nhttps://railway.com/template/2YO_QL?referralCode=RfzFur\n\nBe careful! Any userbots are officially prohibited on RailWay, if your account is banned, neither the creator nor other people are to blame for this."
jamhost_install: "Proceed to @jamhostbot, type <code>/pay</code> and follow its instructions"
module_switch: "<pre><code class="language-heroku">dlm https://raw.githubusercontent.com/coddrago/modules/main/SwitchToHeroku.py</code></pre>"
userland_install: "<b>Install UserLAnd from</b> <a href="https://play.google.com/store/apps/details?id=tech.ula">the link</a>\n\n<b>Open it, choose Ubuntu —&gt; Minimal —&gt; Terminal</b>\n\n<b>Wait for the distribution to install, you can pour some tea</b>\n\n<b>After successful installation, a terminal will open in front of you, write there:</b>\n<pre><code class="language-shell">sudo apt update &amp;&amp; sudo apt upgrade -y &amp;&amp; sudo apt install python3 git python3-pip -y &amp;&amp; git clone https://github.com/coddrago/Heroku &amp;&amp; cd Heroku &amp;&amp; sudo pip install -r requirements.txt &amp;&amp; python3 -m hikka</code></pre>\n\n<b>At the end of the installation, a link will appear, follow it and enter your account details to log in.\n\nVoila! You have installed Heroku on UserLAnd.</b>"
module_switch_install: "<pre><code class=\"language-heroku\">dlm https://raw.githubusercontent.com/coddrago/modules/main/SwitchToHeroku.py</code></pre>"
userland_install: "<b>Install UserLAnd from</b> <a href=\"https://play.google.com/store/apps/details?id=tech.ula\">the link</a>\n\n<b>Open it, choose Ubuntu —&gt; Minimal —&gt; Terminal</b>\n\n<b>Wait for the distribution to install, you can pour some tea</b>\n\n<b>After successful installation, a terminal will open in front of you, write there:</b>\n<pre><code class=\"language-shell\">sudo apt update &amp;&amp; sudo apt upgrade -y &amp;&amp; sudo apt install python3 git python3-pip -y &amp;&amp; git clone https://github.com/coddrago/Heroku &amp;&amp; cd Heroku &amp;&amp; sudo pip install -r requirements.txt &amp;&amp; python3 -m hikka</code></pre>\n\n<b>At the end of the installation, a link will appear, follow it and enter your account details to log in.\n\nVoila! You have installed Heroku on UserLAnd.</b>"
too_many_args: "<emoji document_id=5210952531676504517>🚫</emoji> <b>Too many args</b>"
blacklisted: "<emoji document_id=5197474765387864959>👍</emoji> <b>Chat {} blacklisted from userbot</b>"
unblacklisted: "<emoji document_id=5197474765387864959>👍</emoji> <b>Chat {} unblacklisted from userbot</b>"

View File

@ -148,7 +148,7 @@ heroku_settings:
_cmd_doc_nonickuser: "Включить NoNick для определенного пользователя"
_cmd_doc_nonickusers: "Показать список активных NoNick пользователей"
_cmd_doc_settings: "Показать настройки"
_cmd_doc_uninstall_hikka: "Удалить Heroku"
_cmd_doc_uninstall_heroku: "Удалить Heroku"
_cmd_doc_watcherbl: "<module> - Включить/выключить смотрителя в текущем чате"
_cmd_doc_watcher: "<модуль> - Управление глобальными правилами смотрителя\nАргументы:\n[-c - только в чатах]\n[-p - только в лс]\n[-o - только исходящие]\n[-i - только входящие]"
_cmd_doc_watchers: "Показать активные смотрители"

View File

@ -247,7 +247,7 @@ settings:
_cmd_doc_blacklistuser: "[користувач] - Заборонити користувачу виконувати команди"
_cmd_doc_cleardb: "Очистити базу даних"
_cmd_doc_delalias: "Видалити аліас для команди"
_cmd_doc_hikka: "Показати версію Heroku"
_cmd_doc_heroku: "Показати версію Heroku"
_cmd_doc_setprefix: "<префікс> - Встановити префікс команд"
_cmd_doc_unblacklist: "[чат] - Увімкнути бота де-небудь"
_cmd_doc_unblacklistuser: "[користувач] - Дозволити користувачу виконувати команди"

View File

@ -45,6 +45,20 @@ class CoreMod(loader.Module):
),
)
async def client_ready(self):
self._markup = utils.chunks(
[
{
"text": self.strings(platform),
"callback": self._inline__choose__installation,
"args": (platform,),
}
for platform in {'termux', 'vds', 'railway',
'jamhost', 'module_switch', 'userland'}
],
2
)
def _process_config_changes(self):
# option is controlled by user only
# it's not a RCE
@ -292,9 +306,15 @@ class CoreMod(loader.Module):
args = utils.get_args_raw(message)
if not args and not self.inline.form(
self.strings("choose_installation")
if (not args or args not in {'-t', '-v', '-r', '-jh', '-ms', '-u'}) and \
(not self.inline.form(
self.strings("choose_installation"),
message,
reply_markup=self._markup,
photo="https://imgur.com/a/HrrFair.png"
)
):
await self.client.send_file(
message.peer_id,
"https://imgur.com/a/HrrFair.png",
@ -308,6 +328,13 @@ class CoreMod(loader.Module):
elif "-jh" in args:
await utils.answer(message, self.strings["jamhost_install"])
elif "-ms" in args:
await utils.answer(message, self.strings["module_switch"])
await utils.answer(message, self.strings["module_switch_install"])
elif "-u" in args:
await utils.answer(message, self.strings["userland_install"])
async def _inline__choose__installation(self, call: InlineCall, platform: str):
await call.edit(
text=self.strings(f'{platform}_install'),
reply_markup=self._markup,
)

View File

@ -130,7 +130,7 @@ class UpdaterMod(loader.Module):
)
@loader.callback_handler()
async def update(self, call: InlineCall):
async def update_call(self, call: InlineCall):
"""Process update buttons clicks"""
if call.data not in {"heroku/update", "heroku/ignore_upd"}:
return